blob: 4c1cd8126460419862c1fa7db4b476cefe2fdf4c [file] [log] [blame]
sebdetdfa86ca2019-04-05 15:15:31 +02001<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>
sebdet373b07b2019-04-26 12:04:26 +02008 <removeHeaders pattern="*" />
sebdet338c2182019-04-25 12:33:31 +02009 <doTry>
10 <to
xg353y9ac30702019-04-19 13:55:40 +020011 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()" />
sebdet338c2182019-04-25 12:33:31 +020018 <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>
sebdetdfa86ca2019-04-05 15:15:31 +020027 </route>
28 </get>
29 <get
30 uri="/v2/loop/{loopName}"
31 outType="org.onap.clamp.loop.Loop"
32 produces="application/json">
33 <route>
sebdet373b07b2019-04-26 12:04:26 +020034 <removeHeaders
35 pattern="*"
36 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +020037 <doTry>
sebdet338c2182019-04-25 12:33:31 +020038 <to
xg353y9ac30702019-04-19 13:55:40 +020039 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()" />
sebdet338c2182019-04-25 12:33:31 +020046 <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>
sebdetdfa86ca2019-04-05 15:15:31 +020055 </route>
56 </get>
57 <get
58 uri="/v2/loop/svgRepresentation/{loopName}"
59 outType="java.lang.String"
60 produces="application/xml">
61 <route>
sebdet373b07b2019-04-26 12:04:26 +020062 <removeHeaders
63 pattern="*"
64 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +020065 <doTry>
sebdet338c2182019-04-25 12:33:31 +020066 <to
xg353y9ac30702019-04-19 13:55:40 +020067 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()" />
sebdet338c2182019-04-25 12:33:31 +020074 <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>
sebdetdfa86ca2019-04-05 15:15:31 +020083 </route>
84 </get>
michal.banka89695a32019-03-12 13:01:26 +010085
sebdetdfa86ca2019-04-05 15:15:31 +020086 <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>
sebdet373b07b2019-04-26 12:04:26 +020093 <removeHeaders
94 pattern="*"
95 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +020096 <doTry>
sebdet338c2182019-04-25 12:33:31 +020097 <to
xg353y9ac30702019-04-19 13:55:40 +020098 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
sebdet338c2182019-04-25 12:33:31 +0200108 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Global Properties UPDATED','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200109 <to
110 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200111 <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>
sebdetdfa86ca2019-04-05 15:15:31 +0200120 </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>
sebdet373b07b2019-04-26 12:04:26 +0200129 <removeHeaders
130 pattern="*"
131 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200132 <doTry>
sebdet338c2182019-04-25 12:33:31 +0200133 <to
xg353y9ac30702019-04-19 13:55:40 +0200134 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
sebdet338c2182019-04-25 12:33:31 +0200144 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational and Guard policies UPDATED','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200145 <to
146 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200147 <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>
sebdetdfa86ca2019-04-05 15:15:31 +0200156 </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>
sebdet373b07b2019-04-26 12:04:26 +0200165 <removeHeaders
166 pattern="*"
167 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200168 <doTry>
sebdet338c2182019-04-25 12:33:31 +0200169 <to
xg353y9ac30702019-04-19 13:55:40 +0200170 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')" />
sebdet338c2182019-04-25 12:33:31 +0200173 <setProperty propertyName="MicroServicePolicyObject">
xg353y9ac30702019-04-19 13:55:40 +0200174 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200175 </setProperty>
sebdet667cb722019-04-11 02:07:44 +0200176
xg353y9ac30702019-04-19 13:55:40 +0200177 <to uri="direct:load-loop" />
178 <to
sebdet338c2182019-04-25 12:33:31 +0200179 uri="bean:org.onap.clamp.loop.LoopController?method=updateMicroservicePolicy(${header.loopName},${exchangeProperty[MicroServicePolicyObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200180 <to
sebdet338c2182019-04-25 12:33:31 +0200181 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Micro Service policies UPDATED','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200182 <to
183 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200184 <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>
sebdetdfa86ca2019-04-05 15:15:31 +0200193 </route>
194 </post>
195 <put
196 uri="/v2/loop/deployLoop/{loopName}"
197 outType="org.onap.clamp.loop.Loop"
198 produces="application/json">
199 <route>
sebdet373b07b2019-04-26 12:04:26 +0200200 <removeHeaders
201 pattern="*"
202 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200203 <doTry>
sebdet338c2182019-04-25 12:33:31 +0200204 <to
xg353y9ac30702019-04-19 13:55:40 +0200205 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="bean:org.onap.clamp.operation.LoopOperation?method=deployLoop(*,${header.loopName})" />
210 <to
211 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200212 <doCatch>
213 <exception>java.lang.Exception</exception>
214 <handled>
215 <constant>false</constant>
216 </handled>
217 <to
218 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
219 </doCatch>
220 </doTry>
sebdetdfa86ca2019-04-05 15:15:31 +0200221 </route>
222 </put>
223 <put
224 uri="/v2/loop/undeployLoop/{loopName}"
225 outType="org.onap.clamp.loop.Loop"
226 produces="application/json">
227 <route>
sebdet373b07b2019-04-26 12:04:26 +0200228 <removeHeaders
229 pattern="*"
230 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200231 <doTry>
sebdet338c2182019-04-25 12:33:31 +0200232 <to
xg353y9ac30702019-04-19 13:55:40 +0200233 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Undeploy the closed loop')" />
234 <to
235 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
236 <to
237 uri="bean:org.onap.clamp.operation.LoopOperation?method=unDeployLoop(${header.loopName})" />
238 <to
239 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200240 <doCatch>
241 <exception>java.lang.Exception</exception>
242 <handled>
243 <constant>false</constant>
244 </handled>
245 <to
246 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
247 </doCatch>
248 </doTry>
sebdetdfa86ca2019-04-05 15:15:31 +0200249 </route>
250 </put>
sebdet667cb722019-04-11 02:07:44 +0200251 <put
sebdet1efe60f2019-04-11 17:58:36 +0200252 uri="/v2/loop/stop/{loopName}"
253 outType="org.onap.clamp.loop.Loop"
254 produces="application/json">
255 <route>
sebdet373b07b2019-04-26 12:04:26 +0200256 <removeHeaders
257 pattern="*"
258 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200259 <doTry>
260 <log
261 loggingLevel="INFO"
262 message="Receive STOP request for loop: ${header.loopName}" />
sebdet338c2182019-04-25 12:33:31 +0200263 <to
xg353y9ac30702019-04-19 13:55:40 +0200264 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog('Stop the closed loop')" />
265 <to
266 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
267 <to uri="direct:load-loop" />
sebdet373b07b2019-04-26 12:04:26 +0200268 <to uri="direct:remove-all-policy-from-active-pdp-group" />
xg353y9ac30702019-04-19 13:55:40 +0200269 <log
270 loggingLevel="INFO"
271 message="STOP request successfully executed for loop: ${body}" />
272 <to
sebdet338c2182019-04-25 12:33:31 +0200273 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200274 <to
275 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
276 <to
277 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200278 <doCatch>
279 <exception>java.lang.Exception</exception>
280 <handled>
281 <constant>false</constant>
282 </handled>
283 <to
284 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
sebdet373b07b2019-04-26 12:04:26 +0200285 <log
286 loggingLevel="ERROR"
287 message="STOP request failed for loop: $${header.loopName}" />
288 <to
sebdet584cc4a2019-05-03 14:32:53 +0200289 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
sebdet338c2182019-04-25 12:33:31 +0200290 </doCatch>
291 </doTry>
sebdet1efe60f2019-04-11 17:58:36 +0200292 </route>
sebdet1efe60f2019-04-11 17:58:36 +0200293 </put>
294 <put
295 uri="/v2/loop/start/{loopName}"
296 outType="org.onap.clamp.loop.Loop"
297 produces="application/json">
298 <route>
sebdet373b07b2019-04-26 12:04:26 +0200299 <removeHeaders
300 pattern="*"
301 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200302 <doTry>
303 <log
304 loggingLevel="INFO"
305 message="Receive START request for loop: ${header.loopName}" />
sebdet338c2182019-04-25 12:33:31 +0200306 <to
xg353y9ac30702019-04-19 13:55:40 +0200307 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog('Start the closed loop')" />
308 <to
309 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
310 <to uri="direct:load-loop" />
sebdet338c2182019-04-25 12:33:31 +0200311
xg353y9ac30702019-04-19 13:55:40 +0200312
sebdet373b07b2019-04-26 12:04:26 +0200313 <to uri="direct:add-all-to-active-pdp-group" />
xg353y9ac30702019-04-19 13:55:40 +0200314 <log
315 loggingLevel="INFO"
sebdet373b07b2019-04-26 12:04:26 +0200316 message="START request successfully executed for loop: ${header.loopName}" />
xg353y9ac30702019-04-19 13:55:40 +0200317 <to
sebdet338c2182019-04-25 12:33:31 +0200318 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200319 <to
320 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
321 <to
322 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200323 <doCatch>
324 <exception>java.lang.Exception</exception>
325 <handled>
326 <constant>false</constant>
327 </handled>
328 <to
329 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
sebdet373b07b2019-04-26 12:04:26 +0200330 <log
331 loggingLevel="ERROR"
332 message="START request failed for loop: ${header.loopName}" />
333 <to
sebdet584cc4a2019-05-03 14:32:53 +0200334 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request failed, Error reported: ${exception}','INFO',${exchangeProperty[loopObject]})" />
sebdet338c2182019-04-25 12:33:31 +0200335 </doCatch>
336 </doTry>
sebdet1efe60f2019-04-11 17:58:36 +0200337 </route>
sebdet1efe60f2019-04-11 17:58:36 +0200338 </put>
339 <put
sebdet667cb722019-04-11 02:07:44 +0200340 uri="/v2/loop/submit/{loopName}"
341 outType="org.onap.clamp.loop.Loop"
342 produces="application/json">
sebdetdfa86ca2019-04-05 15:15:31 +0200343 <route>
sebdet373b07b2019-04-26 12:04:26 +0200344 <removeHeaders
345 pattern="*"
346 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200347 <doTry>
sebdet919ef9d2019-04-08 18:32:26 +0200348 <log
349 loggingLevel="INFO"
xg353y9ac30702019-04-19 13:55:40 +0200350 message="Receive SUBMIT request for loop: ${header.loopName}" />
sebdet338c2182019-04-25 12:33:31 +0200351 <to
352 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Submit the closed loop')" />
xg353y9ac30702019-04-19 13:55:40 +0200353 <to
354 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
355 <to uri="direct:load-loop" />
356 <to
sebdet338c2182019-04-25 12:33:31 +0200357 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive SUBMIT request','INFO',${exchangeProperty[loopObject]})" />
358 <setProperty propertyName="raiseHttpExceptionFlag">
sebdetdfa86ca2019-04-05 15:15:31 +0200359 <simple resultType="java.lang.Boolean">false</simple>
sebdet338c2182019-04-25 12:33:31 +0200360 </setProperty>
sebdet373b07b2019-04-26 12:04:26 +0200361 <to uri="direct:remove-all-policy-from-active-pdp-group" />
sebdet919ef9d2019-04-08 18:32:26 +0200362 <log
363 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200364 message="Processing all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}" />
sebdet919ef9d2019-04-08 18:32:26 +0200365 <split>
sebdet338c2182019-04-25 12:33:31 +0200366 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
sebdet919ef9d2019-04-08 18:32:26 +0200367 </simple>
sebdet338c2182019-04-25 12:33:31 +0200368 <setProperty propertyName="microServicePolicy">
sebdet919ef9d2019-04-08 18:32:26 +0200369 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200370 </setProperty>
sebdet919ef9d2019-04-08 18:32:26 +0200371 <log
372 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200373 message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
374 <setProperty propertyName="raiseHttpExceptionFlag">
sebdet919ef9d2019-04-08 18:32:26 +0200375 <simple resultType="java.lang.Boolean">false</simple>
sebdet338c2182019-04-25 12:33:31 +0200376 </setProperty>
sebdet373b07b2019-04-26 12:04:26 +0200377 <to uri="direct:delete-micro-service-policy" />
378 <to uri="direct:create-micro-service-policy" />
sebdet919ef9d2019-04-08 18:32:26 +0200379 </split>
xg353y9ac30702019-04-19 13:55:40 +0200380 <log
381 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200382 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
xg353y9ac30702019-04-19 13:55:40 +0200383 <split>
sebdet338c2182019-04-25 12:33:31 +0200384 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
xg353y9ac30702019-04-19 13:55:40 +0200385 </simple>
sebdet338c2182019-04-25 12:33:31 +0200386 <setProperty propertyName="operationalPolicy">
xg353y9ac30702019-04-19 13:55:40 +0200387 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200388 </setProperty>
xg353y9ac30702019-04-19 13:55:40 +0200389 <log
390 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200391 message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
392 <setProperty propertyName="raiseHttpExceptionFlag">
xg353y9ac30702019-04-19 13:55:40 +0200393 <simple resultType="java.lang.Boolean">false</simple>
sebdet338c2182019-04-25 12:33:31 +0200394 </setProperty>
sebdet667cb722019-04-11 02:07:44 +0200395
sebdet373b07b2019-04-26 12:04:26 +0200396 <to uri="direct:delete-operational-policy" />
397 <to uri="direct:create-operational-policy" />
sebdet338c2182019-04-25 12:33:31 +0200398
xg353y9ac30702019-04-19 13:55:40 +0200399 <log
400 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200401 message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
xg353y9ac30702019-04-19 13:55:40 +0200402 <split>
sebdet338c2182019-04-25 12:33:31 +0200403 <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
xg353y9ac30702019-04-19 13:55:40 +0200404 </simple>
sebdet338c2182019-04-25 12:33:31 +0200405 <setProperty propertyName="guardPolicy">
xg353y9ac30702019-04-19 13:55:40 +0200406 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200407 </setProperty>
xg353y9ac30702019-04-19 13:55:40 +0200408 <log
409 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200410 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
xg353y9ac30702019-04-19 13:55:40 +0200411
sebdet338c2182019-04-25 12:33:31 +0200412 <setProperty propertyName="raiseHttpExceptionFlag">
xg353y9ac30702019-04-19 13:55:40 +0200413 <simple resultType="java.lang.Boolean">false</simple>
sebdet338c2182019-04-25 12:33:31 +0200414 </setProperty>
sebdet373b07b2019-04-26 12:04:26 +0200415 <to uri="direct:delete-guard-policy" />
416 <to uri="direct:create-guard-policy" />
xg353y9ac30702019-04-19 13:55:40 +0200417 </split>
418 </split>
sebdet338c2182019-04-25 12:33:31 +0200419
sebdet373b07b2019-04-26 12:04:26 +0200420 <to uri="direct:add-all-to-active-pdp-group" />
xg353y9ac30702019-04-19 13:55:40 +0200421
422 <log
423 loggingLevel="INFO"
sebdet373b07b2019-04-26 12:04:26 +0200424 message="SUBMIT request successfully executed for loop: ${header.loopName}" />
xg353y9ac30702019-04-19 13:55:40 +0200425 <to
sebdet338c2182019-04-25 12:33:31 +0200426 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200427 <to
428 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
429 <to
430 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200431 <doCatch>
432 <exception>java.lang.Exception</exception>
433 <handled>
434 <constant>false</constant>
435 </handled>
436 <to
437 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
sebdet373b07b2019-04-26 12:04:26 +0200438 <log
439 loggingLevel="ERROR"
440 message="SUBMIT request failed for loop: ${header.loopName}" />
441 <to
sebdet584cc4a2019-05-03 14:32:53 +0200442 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
sebdet338c2182019-04-25 12:33:31 +0200443 </doCatch>
444 </doTry>
sebdetdfa86ca2019-04-05 15:15:31 +0200445 </route>
446 </put>
sebdet919ef9d2019-04-08 18:32:26 +0200447 <put uri="/v2/loop/delete/{loopName}">
sebdetdfa86ca2019-04-05 15:15:31 +0200448 <route>
sebdet373b07b2019-04-26 12:04:26 +0200449 <removeHeaders
450 pattern="*"
451 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200452 <doTry>
sebdetcd64cc42019-04-10 14:07:35 +0200453 <log
454 loggingLevel="INFO"
xg353y9ac30702019-04-19 13:55:40 +0200455 message="Receive DELETE request for loop: ${header.loopName}" />
sebdet338c2182019-04-25 12:33:31 +0200456 <to
xg353y9ac30702019-04-19 13:55:40 +0200457 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog('Delete the closed loop')" />
458 <to
459 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
460 <to uri="direct:load-loop" />
461 <to
sebdet338c2182019-04-25 12:33:31 +0200462 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive DELETE request','INFO',${exchangeProperty[loopObject]})" />
sebdet373b07b2019-04-26 12:04:26 +0200463 <to uri="direct:remove-all-policy-from-active-pdp-group" />
sebdetcd64cc42019-04-10 14:07:35 +0200464 <split>
sebdet338c2182019-04-25 12:33:31 +0200465 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
sebdetcd64cc42019-04-10 14:07:35 +0200466 </simple>
sebdet338c2182019-04-25 12:33:31 +0200467 <setProperty propertyName="microServicePolicy">
sebdetcd64cc42019-04-10 14:07:35 +0200468 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200469 </setProperty>
sebdetcd64cc42019-04-10 14:07:35 +0200470 <log
471 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200472 message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
sebdet373b07b2019-04-26 12:04:26 +0200473 <to uri="direct:delete-micro-service-policy" />
sebdetcd64cc42019-04-10 14:07:35 +0200474 </split>
xg353y9ac30702019-04-19 13:55:40 +0200475
476 <log
477 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200478 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
xg353y9ac30702019-04-19 13:55:40 +0200479 <split>
sebdet338c2182019-04-25 12:33:31 +0200480 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
xg353y9ac30702019-04-19 13:55:40 +0200481 </simple>
sebdet338c2182019-04-25 12:33:31 +0200482 <setProperty propertyName="operationalPolicy">
xg353y9ac30702019-04-19 13:55:40 +0200483 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200484 </setProperty>
xg353y9ac30702019-04-19 13:55:40 +0200485 <log
486 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200487 message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
sebdet373b07b2019-04-26 12:04:26 +0200488 <to uri="direct:delete-operational-policy" />
xg353y9ac30702019-04-19 13:55:40 +0200489 <log
490 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200491 message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
xg353y9ac30702019-04-19 13:55:40 +0200492 <split>
sebdet338c2182019-04-25 12:33:31 +0200493 <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
xg353y9ac30702019-04-19 13:55:40 +0200494 </simple>
sebdet338c2182019-04-25 12:33:31 +0200495 <setProperty propertyName="guardPolicy">
xg353y9ac30702019-04-19 13:55:40 +0200496 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200497 </setProperty>
xg353y9ac30702019-04-19 13:55:40 +0200498 <log
499 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200500 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
sebdet373b07b2019-04-26 12:04:26 +0200501 <to uri="direct:delete-guard-policy" />
xg353y9ac30702019-04-19 13:55:40 +0200502 </split>
503 </split>
504 <to
505 uri="bean:org.onap.clamp.loop.log.LoopService?method=deleteLoop(${header.loopName})" />
506 <log
507 loggingLevel="INFO"
sebdet373b07b2019-04-26 12:04:26 +0200508 message="DELETE request successfully executed for loop: ${header.loopName}" />
xg353y9ac30702019-04-19 13:55:40 +0200509 <to
sebdet338c2182019-04-25 12:33:31 +0200510 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200511 <to
512 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200513 <doCatch>
514 <exception>java.lang.Exception</exception>
515 <handled>
516 <constant>false</constant>
517 </handled>
518 <to
519 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
sebdet373b07b2019-04-26 12:04:26 +0200520 <log
521 loggingLevel="ERROR"
522 message="DELETE request failed for loop: ${header.loopName}" />
523 <to
sebdet584cc4a2019-05-03 14:32:53 +0200524 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
sebdet338c2182019-04-25 12:33:31 +0200525 </doCatch>
526 </doTry>
sebdetdfa86ca2019-04-05 15:15:31 +0200527 </route>
528 </put>
529 </rest>
Krysiak Adam5f14c7a2019-03-01 15:32:19 +0100530</rests>