2640d6bd676db2507a8d6c5de3e89705b093138f
[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                                         <split>
211                                                 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
212                                                 </simple>
213                                                 <setProperty propertyName="operationalPolicy">
214                                                         <simple>${body}</simple>
215                                                 </setProperty>
216                                                 <to 
217                                                         uri="direct:get-status-from-policy" />
218                                         </split>
219                                         <to 
220                                                 uri="direct:get-status-from-dcae" />
221                                         <choice>
222                                         <log
223                                                 loggingLevel="INFO"
224                                                 message="policy status0: ${exchangeProperty[policyStatus]}"></log>
225                                         <log
226                                                 loggingLevel="INFO"
227                                                 message="dcae status0: ${exchangeProperty[dcaeStatus]}"></log>
228                                                 <when>
229                                                         <simple> ${exchangeProperty[policyStatus]} == 'SUBMITTED' and
230                                                                 ${exchangeProperty[dcaeStatus]} == 'NOT_DEPLOYED'
231                                                         </simple>
232                                                         <to
233                                                                 uri="direct:deploy-closedloop" />
234                                                 </when>
235                                                 <otherwise>
236                                                         <log
237                                                                 loggingLevel="INFO"
238                                                                 message="Closed Loop is in state ${exchangeProperty[policyStatus]}, it can only be deployed when in state SUBMIT" />
239                                                         <to
240                                                                 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]})" />
241                                                 </otherwise>
242                                         </choice>
243                                         <to
244                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
245                                         <doCatch>
246                                                 <exception>java.lang.Exception</exception>
247                                                 <handled>
248                                                         <constant>false</constant>
249                                                 </handled>
250                                                 <to
251                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
252                                                 <log
253                                                         loggingLevel="ERROR"
254                                                         message="Deploy request failed for loop: ${header.loopName}" />
255                                                 <to
256                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Deploy request failed','ERROR',${exchangeProperty[loopObject]})" />
257                                         </doCatch>
258                                 </doTry>
259                         </route>
260                 </put>
261                 <put
262                         uri="/v2/loop/undeployLoop/{loopName}"
263                         outType="org.onap.clamp.loop.Loop"
264                         produces="application/json">
265                         <route>
266                                 <removeHeaders
267                                         pattern="*"
268                                         excludePattern="loopName" />
269                                 <doTry>
270                                         <to
271                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Undeploy the closed loop')" />
272                                         <to
273                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
274                                         <to
275                                                 uri="direct:load-loop" />
276                                         <to 
277                                                 uri="direct:get-status-from-dcae" />
278                                         <choice>
279                                                 <when>
280                                                         <simple> ${exchangeProperty[dcaeStatus]} == 'DEPLOYED'
281                                                         </simple>
282                                                         <to
283                                                                 uri="direct:undeploy-closedloop" />
284                                                 </when>
285                                                 <otherwise>
286                                                         <log
287                                                                 loggingLevel="INFO"
288                                                                 message="Closed Loop is in state ${exchangeProperty[dcaeStatus]}, it can only be undeployed when in state DEPLOYED" />
289                                                         <to
290                                                                 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]})" />
291                                                 </otherwise>
292                                         </choice>
293                                         <to
294                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
295                                         <doCatch>
296                                                 <exception>java.lang.Exception</exception>
297                                                 <handled>
298                                                         <constant>false</constant>
299                                                 </handled>
300                                                 <to
301                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
302                                                 <log
303                                                         loggingLevel="ERROR"
304                                                         message="Undeploy request failed for loop: $${header.loopName}" />
305                                                 <to
306                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Undeploy request failed','ERROR',${exchangeProperty[loopObject]})" />
307                                         </doCatch>
308                                 </doTry>
309                         </route>
310                 </put>
311                 <put
312                         uri="/v2/loop/stop/{loopName}"
313                         outType="org.onap.clamp.loop.Loop"
314                         produces="application/json">
315                         <route>
316                                 <removeHeaders
317                                         pattern="*"
318                                         excludePattern="loopName" />
319                                 <doTry>
320                                         <log
321                                                 loggingLevel="INFO"
322                                                 message="Receive STOP request for loop: ${header.loopName}" />
323                                         <to
324                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog('Stop the closed loop')" />
325                                         <to
326                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
327                                         <to uri="direct:load-loop" />
328                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
329                                         <log
330                                                 loggingLevel="INFO"
331                                                 message="STOP request successfully executed for loop: ${body}" />
332                                         <to
333                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${exchangeProperty[loopObject]})" />
334                                         <to
335                                                 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
336                                         <to
337                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
338                                         <doCatch>
339                                                 <exception>java.lang.Exception</exception>
340                                                 <handled>
341                                                         <constant>false</constant>
342                                                 </handled>
343                                                 <to
344                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
345                                                 <log
346                                                         loggingLevel="ERROR"
347                                                         message="STOP request failed for loop: $${header.loopName}" />
348                                                 <to
349                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed','ERROR',${exchangeProperty[loopObject]})" />
350                                         </doCatch>
351                                 </doTry>
352                         </route>
353                 </put>
354                 <put
355                         uri="/v2/loop/start/{loopName}"
356                         outType="org.onap.clamp.loop.Loop"
357                         produces="application/json">
358                         <route>
359                                 <removeHeaders
360                                         pattern="*"
361                                         excludePattern="loopName" />
362                                 <doTry>
363                                         <log
364                                                 loggingLevel="INFO"
365                                                 message="Receive START request for loop: ${header.loopName}" />
366                                         <to
367                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog('Start the closed loop')" />
368                                         <to
369                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
370                                         <to uri="direct:load-loop" />
371
372
373                                         <to uri="direct:add-all-to-active-pdp-group" />
374                                         <log
375                                                 loggingLevel="INFO"
376                                                 message="START request successfully executed for loop: ${header.loopName}" />
377                                         <to
378                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request successfully executed','INFO',${exchangeProperty[loopObject]})" />
379                                         <to
380                                                 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
381                                         <to
382                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
383                                         <doCatch>
384                                                 <exception>java.lang.Exception</exception>
385                                                 <handled>
386                                                         <constant>false</constant>
387                                                 </handled>
388                                                 <to
389                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
390                                                 <log
391                                                         loggingLevel="ERROR"
392                                                         message="START request failed for loop: ${header.loopName}" />
393                                                 <to
394                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request failed','INFO',${exchangeProperty[loopObject]})" />
395                                         </doCatch>
396                                 </doTry>
397                         </route>
398                 </put>
399                 <put
400                         uri="/v2/loop/submit/{loopName}"
401                         outType="org.onap.clamp.loop.Loop"
402                         produces="application/json">
403                         <route>
404                                 <removeHeaders
405                                         pattern="*"
406                                         excludePattern="loopName" />
407                                 <doTry>
408                                         <log
409                                                 loggingLevel="INFO"
410                                                 message="Receive SUBMIT request for loop: ${header.loopName}" />
411                                         <to
412                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Submit the closed loop')" />
413                                         <to
414                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
415                                         <to uri="direct:load-loop" />
416                                         <to
417                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive SUBMIT request','INFO',${exchangeProperty[loopObject]})" />
418                                         <setProperty propertyName="raiseHttpExceptionFlag">
419                                                 <simple resultType="java.lang.Boolean">false</simple>
420                                         </setProperty>
421                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
422                                         <log
423                                                 loggingLevel="INFO"
424                                                 message="Processing all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}" />
425                                         <split>
426                                                 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
427                                                 </simple>
428                                                 <setProperty propertyName="microServicePolicy">
429                                                         <simple>${body}</simple>
430                                                 </setProperty>
431                                                 <log
432                                                         loggingLevel="INFO"
433                                                         message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
434                                                 <setProperty propertyName="raiseHttpExceptionFlag">
435                                                         <simple resultType="java.lang.Boolean">false</simple>
436                                                 </setProperty>
437                                                 <to uri="direct:delete-micro-service-policy" />
438                                                 <to uri="direct:create-micro-service-policy" />
439                                         </split>
440                                         <log
441                                                 loggingLevel="INFO"
442                                                 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
443                                         <split>
444                                                 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
445                                                 </simple>
446                                                 <setProperty propertyName="operationalPolicy">
447                                                         <simple>${body}</simple>
448                                                 </setProperty>
449                                                 <log
450                                                         loggingLevel="INFO"
451                                                         message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
452                                                 <setProperty propertyName="raiseHttpExceptionFlag">
453                                                         <simple resultType="java.lang.Boolean">false</simple>
454                                                 </setProperty>
455
456                                                 <to uri="direct:delete-operational-policy" />
457                                                 <to uri="direct:create-operational-policy" />
458
459                                                 <log
460                                                         loggingLevel="INFO"
461                                                         message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
462                                                 <split>
463                                                         <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
464                                                         </simple>
465                                                         <setProperty propertyName="guardPolicy">
466                                                                 <simple>${body}</simple>
467                                                         </setProperty>
468                                                         <log
469                                                                 loggingLevel="INFO"
470                                                                 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
471
472                                                         <setProperty propertyName="raiseHttpExceptionFlag">
473                                                                 <simple resultType="java.lang.Boolean">false</simple>
474                                                         </setProperty>
475                                                         <to uri="direct:delete-guard-policy" />
476                                                         <to uri="direct:create-guard-policy" />
477                                                 </split>
478                                         </split>
479
480                                         <to uri="direct:add-all-to-active-pdp-group" />
481
482                                         <log
483                                                 loggingLevel="INFO"
484                                                 message="SUBMIT request successfully executed for loop: ${header.loopName}" />
485                                         <to
486                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" />
487                                         <to
488                                                 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
489                                         <to
490                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
491                                         <doCatch>
492                                                 <exception>java.lang.Exception</exception>
493                                                 <handled>
494                                                         <constant>false</constant>
495                                                 </handled>
496                                                 <to
497                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
498                                                 <log
499                                                         loggingLevel="ERROR"
500                                                         message="SUBMIT request failed for loop: ${header.loopName}" />
501                                                 <to
502                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed','ERROR',${exchangeProperty[loopObject]})" />
503                                         </doCatch>
504                                 </doTry>
505                         </route>
506                 </put>
507                 <put uri="/v2/loop/delete/{loopName}">
508                         <route>
509                                 <removeHeaders
510                                         pattern="*"
511                                         excludePattern="loopName" />
512                                 <doTry>
513                                         <log
514                                                 loggingLevel="INFO"
515                                                 message="Receive DELETE request for loop: ${header.loopName}" />
516                                         <to
517                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog('Delete the closed loop')" />
518                                         <to
519                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
520                                         <to uri="direct:load-loop" />
521                                         <to
522                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive DELETE request','INFO',${exchangeProperty[loopObject]})" />
523                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
524                                         <split>
525                                                 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
526                                                 </simple>
527                                                 <setProperty propertyName="microServicePolicy">
528                                                         <simple>${body}</simple>
529                                                 </setProperty>
530                                                 <log
531                                                         loggingLevel="INFO"
532                                                         message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
533                                                 <to uri="direct:delete-micro-service-policy" />
534                                         </split>
535
536                                         <log
537                                                 loggingLevel="INFO"
538                                                 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
539                                         <split>
540                                                 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
541                                                 </simple>
542                                                 <setProperty propertyName="operationalPolicy">
543                                                         <simple>${body}</simple>
544                                                 </setProperty>
545                                                 <log
546                                                         loggingLevel="INFO"
547                                                         message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
548                                                 <to uri="direct:delete-operational-policy" />
549                                                 <log
550                                                         loggingLevel="INFO"
551                                                         message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
552                                                 <split>
553                                                         <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
554                                                         </simple>
555                                                         <setProperty propertyName="guardPolicy">
556                                                                 <simple>${body}</simple>
557                                                         </setProperty>
558                                                         <log
559                                                                 loggingLevel="INFO"
560                                                                 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
561                                                         <to uri="direct:delete-guard-policy" />
562                                                 </split>
563                                         </split>
564                                         <to
565                                                 uri="bean:org.onap.clamp.loop.log.LoopService?method=deleteLoop(${header.loopName})" />
566                                         <log
567                                                 loggingLevel="INFO"
568                                                 message="DELETE request successfully executed for loop: ${header.loopName}" />
569                                         <to
570                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request successfully executed','INFO',${exchangeProperty[loopObject]})" />
571                                         <to
572                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
573                                         <doCatch>
574                                                 <exception>java.lang.Exception</exception>
575                                                 <handled>
576                                                         <constant>false</constant>
577                                                 </handled>
578                                                 <to
579                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
580                                                 <log
581                                                         loggingLevel="ERROR"
582                                                         message="DELETE request failed for loop: ${header.loopName}" />
583                                                 <to
584                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed','ERROR',${exchangeProperty[loopObject]})" />
585                                         </doCatch>
586                                 </doTry>
587                         </route>
588                 </put>
589                 <get
590                         uri="/v2/loop/getstatus/{loopName}"
591                         outType="org.onap.clamp.loop.Loop"
592                         produces="application/json">
593                         <route>
594                                 <removeHeaders pattern="*" excludePattern="loopName"/>
595                                 <doTry>
596                                         <log
597                                                 loggingLevel="INFO"
598                                                 message="Get current status for loop: ${header.loopName}" />
599                                         <to
600                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get the closed loop status')" />
601                                         <to
602                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
603                                         <to uri="direct:load-loop" />
604                                         <to
605                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive GET STATUS request','INFO',${exchangeProperty[loopObject]})" />
606                                         <setProperty propertyName="raiseHttpExceptionFlag">
607                                                 <simple resultType="java.lang.Boolean">false</simple>
608                                         </setProperty>
609                                         <to uri="direct:get-status-from-policy" />
610                                         <to uri="direct:get-status-from-dcae" />
611                                         <to
612                                                 uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopStatus(${exchangeProperty[policyStatus], ${exchangeProperty[dcaeStatus])" />
613
614                                         <log
615                                                 loggingLevel="INFO"
616                                                 message="Get Status request successfully executed for loop: ${body}" />
617                                         <to
618                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request successfully executed','INFO',${exchangeProperty[loopObject]})" />
619                                         <to
620                                                 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
621                                         <to
622                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
623                                         <doCatch>
624                                                 <exception>java.lang.Exception</exception>
625                                                 <handled>
626                                                         <constant>false</constant>
627                                                 </handled>
628                                                 <to
629                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
630                                                 <log
631                                                         loggingLevel="ERROR"
632                                                         message="Get Status request failed for loop: ${header.loopName}" />
633                                                 <to
634                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request failed','ERROR',${exchangeProperty[loopObject]})" />
635                                         </doCatch>
636                                 </doTry>
637                         </route>
638                 </get>
639         </rest>
640 </rests>