Fix the loop log issue
[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
4                         uri="/v2/loop/getAllNames"
5                         outType="java.lang.String[]"
6                         produces="application/json">
7                         <route>
8                                 <removeHeaders pattern="*" />
9                                 <doTry>
10                                         <to
11                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get All ClosedLoop')" />
12                                         <to
13                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
14                                         <to
15                                                 uri="bean:org.onap.clamp.loop.LoopController?method=getLoopNames()" />
16                                         <to
17                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
18                                         <doCatch>
19                                                 <exception>java.lang.Exception</exception>
20                                                 <handled>
21                                                         <constant>false</constant>
22                                                 </handled>
23                                                 <to
24                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
25                                         </doCatch>
26                                 </doTry>
27                         </route>
28                 </get>
29                 <get
30                         uri="/v2/loop/{loopName}"
31                         outType="org.onap.clamp.loop.Loop"
32                         produces="application/json">
33                         <route>
34                                 <removeHeaders
35                                         pattern="*"
36                                         excludePattern="loopName" />
37                                 <doTry>
38                                         <to
39                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get Closed Loop')" />
40                                         <to
41                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
42                                         <to
43                                                 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
44                                         <to
45                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
46                                         <doCatch>
47                                                 <exception>java.lang.Exception</exception>
48                                                 <handled>
49                                                         <constant>false</constant>
50                                                 </handled>
51                                                 <to
52                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
53                                         </doCatch>
54                                 </doTry>
55                         </route>
56                 </get>
57                 <get
58                         uri="/v2/loop/svgRepresentation/{loopName}"
59                         outType="java.lang.String"
60                         produces="application/xml">
61                         <route>
62                                 <removeHeaders
63                                         pattern="*"
64                                         excludePattern="loopName" />
65                                 <doTry>
66                                         <to
67                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get SVG Representation')" />
68                                         <to
69                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
70                                         <to
71                                                 uri="bean:org.onap.clamp.loop.LoopController?method=getSVGRepresentation(${header.loopName})" />
72                                         <to
73                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
74                                         <doCatch>
75                                                 <exception>java.lang.Exception</exception>
76                                                 <handled>
77                                                         <constant>false</constant>
78                                                 </handled>
79                                                 <to
80                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
81                                         </doCatch>
82                                 </doTry>
83                         </route>
84                 </get>
85
86                 <post
87                         uri="/v2/loop/updateGlobalProperties/{loopName}"
88                         type="com.google.gson.JsonObject"
89                         consumes="application/json"
90                         outType="org.onap.clamp.loop.Loop"
91                         produces="application/json">
92                         <route>
93                                 <removeHeaders
94                                         pattern="*"
95                                         excludePattern="loopName" />
96                                 <doTry>
97                                         <to
98                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update the global properties')" />
99                                         <to
100                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
101                                         <setHeader headerName="GlobalPropertiesJson">
102                                                 <simple>${body}</simple>
103                                         </setHeader>
104                                         <to uri="direct:load-loop" />
105                                         <to
106                                                 uri="bean:org.onap.clamp.loop.LoopController?method=updateGlobalPropertiesJson(${header.loopName},${header.GlobalPropertiesJson})" />
107                                         <to
108                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Global Properties UPDATED','INFO',${exchangeProperty[loopObject]})" />
109                                         <to
110                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
111                                         <doCatch>
112                                                 <exception>java.lang.Exception</exception>
113                                                 <handled>
114                                                         <constant>false</constant>
115                                                 </handled>
116                                                 <to
117                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
118                                         </doCatch>
119                                 </doTry>
120                         </route>
121                 </post>
122                 <post
123                         uri="/v2/loop/updateOperationalPolicies/{loopName}"
124                         type="com.google.gson.JsonArray"
125                         consumes="application/json"
126                         outType="org.onap.clamp.loop.Loop"
127                         produces="application/json">
128                         <route>
129                                 <removeHeaders
130                                         pattern="*"
131                                         excludePattern="loopName" />
132                                 <doTry>
133                                         <to
134                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update operational policies')" />
135                                         <to
136                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
137                                         <setHeader headerName="OperationalPoliciesArray">
138                                                 <simple>${body}</simple>
139                                         </setHeader>
140                                         <to uri="direct:load-loop" />
141                                         <to
142                                                 uri="bean:org.onap.clamp.loop.LoopController?method=updateOperationalPolicies(${header.loopName},${header.OperationalPoliciesArray})" />
143                                         <to
144                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational and Guard policies UPDATED','INFO',${exchangeProperty[loopObject]})" />
145                                         <to
146                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
147                                         <doCatch>
148                                                 <exception>java.lang.Exception</exception>
149                                                 <handled>
150                                                         <constant>false</constant>
151                                                 </handled>
152                                                 <to
153                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
154                                         </doCatch>
155                                 </doTry>
156                         </route>
157                 </post>
158                 <post
159                         uri="/v2/loop/updateMicroservicePolicy/{loopName}"
160                         type="org.onap.clamp.policy.microservice.MicroServicePolicy"
161                         consumes="application/json"
162                         outType="org.onap.clamp.policy.microservice.MicroServicePolicy"
163                         produces="application/json">
164                         <route>
165                                 <removeHeaders
166                                         pattern="*"
167                                         excludePattern="loopName" />
168                                 <doTry>
169                                         <to
170                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update Microservice policies')" />
171                                         <to
172                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
173                                         <setProperty propertyName="MicroServicePolicyObject">
174                                                 <simple>${body}</simple>
175                                         </setProperty>
176
177                                         <to uri="direct:load-loop" />
178                                         <to
179                                                 uri="bean:org.onap.clamp.loop.LoopController?method=updateMicroservicePolicy(${header.loopName},${exchangeProperty[MicroServicePolicyObject]})" />
180                                         <to
181                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Micro Service policies UPDATED','INFO',${exchangeProperty[loopObject]})" />
182                                         <to
183                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
184                                         <doCatch>
185                                                 <exception>java.lang.Exception</exception>
186                                                 <handled>
187                                                         <constant>false</constant>
188                                                 </handled>
189                                                 <to
190                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
191                                         </doCatch>
192                                 </doTry>
193                         </route>
194                 </post>
195                 <put
196                         uri="/v2/loop/deployLoop/{loopName}"
197                         outType="org.onap.clamp.loop.Loop"
198                         produces="application/json">
199                         <route>
200                                 <removeHeaders
201                                         pattern="*"
202                                         excludePattern="loopName" />
203                                 <doTry>
204                                         <to
205                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Deploy the closed loop')" />
206                                         <to
207                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
208                                         <to
209                                                 uri="direct:load-loop" />
210                                         <to
211                                                 uri="direct:get-status-from-policy" />
212                                         <to
213                                                 uri="direct:get-status-from-dcae" />
214                                         <log
215                                                 loggingLevel="INFO"
216                                                 message="policy status0000: ${exchangeProperty[policyStatus]}"></log>
217                                         <choice>
218                                                 <when>
219                                                         <simple> ${exchangeProperty[policyStatus]} == 'SUBMITTED' and
220                                                                 ${exchangeProperty[dcaeStatus]} == 'NOT_DEPLOYED'
221                                                         </simple>
222                                                         <to
223                                                                 uri="direct:deploy-closedloop" />
224                                                 </when>
225                                                 <otherwise>
226                                                         <log
227                                                                 loggingLevel="INFO"
228                                                                 message="Closed Loop is in state ${exchangeProperty[policyStatus]}, it can only be deployed when in state SUBMIT" />
229                                                         <to
230                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Closed Loop is in state ${exchangeProperty[policyStatus]}, it can only be deployed when in state SUBMIT','ERROR',${exchangeProperty[loopObject]})" />
231                                                 </otherwise>
232                                         </choice>
233                                         <to
234                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
235                                         <doCatch>
236                                                 <exception>java.lang.Exception</exception>
237                                                 <handled>
238                                                         <constant>false</constant>
239                                                 </handled>
240                                                 <to
241                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
242                                                 <log
243                                                         loggingLevel="ERROR"
244                                                         message="Deploy request failed for loop: ${header.loopName}" />
245                                                 <to
246                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Deploy request failed','ERROR',${exchangeProperty[loopObject]})" />
247                                         </doCatch>
248                                 </doTry>
249                         </route>
250                 </put>
251                 <put
252                         uri="/v2/loop/undeployLoop/{loopName}"
253                         outType="org.onap.clamp.loop.Loop"
254                         produces="application/json">
255                         <route>
256                                 <removeHeaders
257                                         pattern="*"
258                                         excludePattern="loopName" />
259                                 <doTry>
260                                         <to
261                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Undeploy the closed loop')" />
262                                         <to
263                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
264                                         <to
265                                                 uri="direct:load-loop" />
266                                         <to 
267                                                 uri="direct:get-status-from-dcae" />
268                                         <choice>
269                                                 <when>
270                                                         <simple> ${exchangeProperty[dcaeStatus]} == 'DEPLOYED'
271                                                         </simple>
272                                                         <to
273                                                                 uri="direct:undeploy-closedloop" />
274                                                 </when>
275                                                 <otherwise>
276                                                         <log
277                                                                 loggingLevel="INFO"
278                                                                 message="Closed Loop is in state ${exchangeProperty[dcaeStatus]}, it can only be undeployed when in state DEPLOYED" />
279                                                         <to
280                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Closed Loop is in state ${exchangeProperty[dcaeStatus]}, it can only be deployed when in state DEPLOYED','ERROR',${exchangeProperty[loopObject]})" />
281                                                 </otherwise>
282                                         </choice>
283                                         <to
284                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
285                                         <doCatch>
286                                                 <exception>java.lang.Exception</exception>
287                                                 <handled>
288                                                         <constant>false</constant>
289                                                 </handled>
290                                                 <to
291                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
292                                                 <log
293                                                         loggingLevel="ERROR"
294                                                         message="Undeploy request failed for loop: $${header.loopName}" />
295                                                 <to
296                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Undeploy request failed','ERROR',${exchangeProperty[loopObject]})" />
297                                         </doCatch>
298                                 </doTry>
299                         </route>
300                 </put>
301                 <put
302                         uri="/v2/loop/stop/{loopName}"
303                         outType="org.onap.clamp.loop.Loop"
304                         produces="application/json">
305                         <route>
306                                 <removeHeaders
307                                         pattern="*"
308                                         excludePattern="loopName" />
309                                 <doTry>
310                                         <log
311                                                 loggingLevel="INFO"
312                                                 message="Receive STOP request for loop: ${header.loopName}" />
313                                         <to
314                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog('Stop the closed loop')" />
315                                         <to
316                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
317                                         <to uri="direct:load-loop" />
318                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
319                                         <log
320                                                 loggingLevel="INFO"
321                                                 message="STOP request successfully executed for loop: ${body}" />
322                                         <to
323                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${exchangeProperty[loopObject]})" />
324                                         <to
325                                                 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
326                                         <to
327                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
328                                         <doCatch>
329                                                 <exception>java.lang.Exception</exception>
330                                                 <handled>
331                                                         <constant>false</constant>
332                                                 </handled>
333                                                 <to
334                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
335                                                 <log
336                                                         loggingLevel="ERROR"
337                                                         message="STOP request failed for loop: $${header.loopName}" />
338                                                 <to
339                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
340                                         </doCatch>
341                                 </doTry>
342                         </route>
343                 </put>
344                 <put
345                         uri="/v2/loop/start/{loopName}"
346                         outType="org.onap.clamp.loop.Loop"
347                         produces="application/json">
348                         <route>
349                                 <removeHeaders
350                                         pattern="*"
351                                         excludePattern="loopName" />
352                                 <doTry>
353                                         <log
354                                                 loggingLevel="INFO"
355                                                 message="Receive START request for loop: ${header.loopName}" />
356                                         <to
357                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog('Start the closed loop')" />
358                                         <to
359                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
360                                         <to uri="direct:load-loop" />
361
362
363                                         <to uri="direct:add-all-to-active-pdp-group" />
364                                         <log
365                                                 loggingLevel="INFO"
366                                                 message="START request successfully executed for loop: ${header.loopName}" />
367                                         <to
368                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request successfully executed','INFO',${exchangeProperty[loopObject]})" />
369                                         <to
370                                                 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
371                                         <to
372                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
373                                         <doCatch>
374                                                 <exception>java.lang.Exception</exception>
375                                                 <handled>
376                                                         <constant>false</constant>
377                                                 </handled>
378                                                 <to
379                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
380                                                 <log
381                                                         loggingLevel="ERROR"
382                                                         message="START request failed for loop: ${header.loopName}" />
383                                                 <to
384                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request failed, Error reported: ${exception}','INFO',${exchangeProperty[loopObject]})" />
385                                         </doCatch>
386                                 </doTry>
387                         </route>
388                 </put>
389                 <put
390                         uri="/v2/loop/submit/{loopName}"
391                         outType="org.onap.clamp.loop.Loop"
392                         produces="application/json">
393                         <route>
394                                 <removeHeaders
395                                         pattern="*"
396                                         excludePattern="loopName" />
397                                 <doTry>
398                                         <log
399                                                 loggingLevel="INFO"
400                                                 message="Receive SUBMIT request for loop: ${header.loopName}" />
401                                         <to
402                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Submit the closed loop')" />
403                                         <to
404                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
405                                         <to uri="direct:load-loop" />
406                                         <to
407                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive SUBMIT request','INFO',${exchangeProperty[loopObject]})" />
408                                         <setProperty propertyName="raiseHttpExceptionFlag">
409                                                 <simple resultType="java.lang.Boolean">false</simple>
410                                         </setProperty>
411                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
412                                         <log
413                                                 loggingLevel="INFO"
414                                                 message="Processing all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}" />
415                                         <split>
416                                                 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
417                                                 </simple>
418                                                 <setProperty propertyName="microServicePolicy">
419                                                         <simple>${body}</simple>
420                                                 </setProperty>
421                                                 <log
422                                                         loggingLevel="INFO"
423                                                         message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
424                                                 <setProperty propertyName="raiseHttpExceptionFlag">
425                                                         <simple resultType="java.lang.Boolean">false</simple>
426                                                 </setProperty>
427                                                 <to uri="direct:delete-micro-service-policy" />
428                                                 <to uri="direct:create-micro-service-policy" />
429                                         </split>
430                                         <log
431                                                 loggingLevel="INFO"
432                                                 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
433                                         <split>
434                                                 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
435                                                 </simple>
436                                                 <setProperty propertyName="operationalPolicy">
437                                                         <simple>${body}</simple>
438                                                 </setProperty>
439                                                 <log
440                                                         loggingLevel="INFO"
441                                                         message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
442                                                 <setProperty propertyName="raiseHttpExceptionFlag">
443                                                         <simple resultType="java.lang.Boolean">false</simple>
444                                                 </setProperty>
445
446                                                 <to uri="direct:delete-operational-policy" />
447                                                 <to uri="direct:create-operational-policy" />
448
449                                                 <log
450                                                         loggingLevel="INFO"
451                                                         message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
452                                                 <split>
453                                                         <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
454                                                         </simple>
455                                                         <setProperty propertyName="guardPolicy">
456                                                                 <simple>${body}</simple>
457                                                         </setProperty>
458                                                         <log
459                                                                 loggingLevel="INFO"
460                                                                 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
461
462                                                         <setProperty propertyName="raiseHttpExceptionFlag">
463                                                                 <simple resultType="java.lang.Boolean">false</simple>
464                                                         </setProperty>
465                                                         <to uri="direct:delete-guard-policy" />
466                                                         <to uri="direct:create-guard-policy" />
467                                                 </split>
468                                         </split>
469
470                                         <to uri="direct:add-all-to-active-pdp-group" />
471
472                                         <log
473                                                 loggingLevel="INFO"
474                                                 message="SUBMIT request successfully executed for loop: ${header.loopName}" />
475                                         <to
476                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" />
477                                         <to
478                                                 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
479                                         <to
480                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
481                                         <doCatch>
482                                                 <exception>java.lang.Exception</exception>
483                                                 <handled>
484                                                         <constant>false</constant>
485                                                 </handled>
486                                                 <to
487                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
488                                                 <log
489                                                         loggingLevel="ERROR"
490                                                         message="SUBMIT request failed for loop: ${header.loopName}" />
491                                                 <to
492                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
493                                         </doCatch>
494                                 </doTry>
495                         </route>
496                 </put>
497                 <put uri="/v2/loop/delete/{loopName}">
498                         <route>
499                                 <removeHeaders
500                                         pattern="*"
501                                         excludePattern="loopName" />
502                                 <doTry>
503                                         <log
504                                                 loggingLevel="INFO"
505                                                 message="Receive DELETE request for loop: ${header.loopName}" />
506                                         <to
507                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog('Delete the closed loop')" />
508                                         <to
509                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
510                                         <to uri="direct:load-loop" />
511                                         <to
512                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive DELETE request','INFO',${exchangeProperty[loopObject]})" />
513                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
514                                         <split>
515                                                 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
516                                                 </simple>
517                                                 <setProperty propertyName="microServicePolicy">
518                                                         <simple>${body}</simple>
519                                                 </setProperty>
520                                                 <log
521                                                         loggingLevel="INFO"
522                                                         message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
523                                                 <to uri="direct:delete-micro-service-policy" />
524                                         </split>
525
526                                         <log
527                                                 loggingLevel="INFO"
528                                                 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
529                                         <split>
530                                                 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
531                                                 </simple>
532                                                 <setProperty propertyName="operationalPolicy">
533                                                         <simple>${body}</simple>
534                                                 </setProperty>
535                                                 <log
536                                                         loggingLevel="INFO"
537                                                         message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
538                                                 <to uri="direct:delete-operational-policy" />
539                                                 <log
540                                                         loggingLevel="INFO"
541                                                         message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
542                                                 <split>
543                                                         <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
544                                                         </simple>
545                                                         <setProperty propertyName="guardPolicy">
546                                                                 <simple>${body}</simple>
547                                                         </setProperty>
548                                                         <log
549                                                                 loggingLevel="INFO"
550                                                                 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
551                                                         <to uri="direct:delete-guard-policy" />
552                                                 </split>
553                                         </split>
554                                         <to
555                                                 uri="bean:org.onap.clamp.loop.log.LoopService?method=deleteLoop(${header.loopName})" />
556                                         <log
557                                                 loggingLevel="INFO"
558                                                 message="DELETE request successfully executed for loop: ${header.loopName}" />
559                                         <to
560                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request successfully executed','INFO',${exchangeProperty[loopObject]})" />
561                                         <to
562                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
563                                         <doCatch>
564                                                 <exception>java.lang.Exception</exception>
565                                                 <handled>
566                                                         <constant>false</constant>
567                                                 </handled>
568                                                 <to
569                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
570                                                 <log
571                                                         loggingLevel="ERROR"
572                                                         message="DELETE request failed for loop: ${header.loopName}" />
573                                                 <to
574                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
575                                         </doCatch>
576                                 </doTry>
577                         </route>
578                 </put>
579                 <get
580                         uri="/v2/loop/getstatus/{loopName}"
581                         outType="org.onap.clamp.loop.Loop"
582                         produces="application/json">
583                         <route>
584                                 <removeHeaders pattern="*" excludePattern="loopName"/>
585                                 <doTry>
586                                         <log
587                                                 loggingLevel="INFO"
588                                                 message="Get current status for loop: ${header.loopName}" />
589                                         <to
590                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get the closed loop status')" />
591                                         <to
592                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
593                                         <to uri="direct:load-loop" />
594                                         <to
595                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive GET STATUS request','INFO',${exchangeProperty[loopObject]})" />
596                                         <setProperty propertyName="raiseHttpExceptionFlag">
597                                                 <simple resultType="java.lang.Boolean">false</simple>
598                                         </setProperty>
599                                         <to uri="direct:get-status-from-policy" />
600                                         <to uri="direct:get-status-from-dcae" />
601                                         <to
602                                                 uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopStatus(${exchangeProperty[loopObject]},${exchangeProperty[policyStatus]}, ${exchangeProperty[dcaeStatus]})" />
603                                         <log
604                                                 loggingLevel="INFO"
605                                                 message="Get Status request successfully executed. The new state is: ${body}" />
606                                         <to
607                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request successfully executed','INFO',${exchangeProperty[loopObject]})" />
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>false</constant>
614                                                 </handled>
615                                                 <to
616                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
617                                                 <log
618                                                         loggingLevel="ERROR"
619                                                         message="Get Status request failed for loop: ${header.loopName}" />
620                                                 <to
621                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request failed','ERROR',${exchangeProperty[loopObject]})" />
622                                         </doCatch>
623                                         <doFinally>
624                                                 <to
625                                                         uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
626                                         </doFinally>
627                                 </doTry>
628                         </route>
629                 </get>
630         </rest>
631 </rests>