blob: 1883145d7b92fc465161185de3af70d2ee978f1a [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
sebdetb328b372019-05-08 15:36:55 +0200205 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DEPLOY the closed loop')" />
xg353y9ac30702019-04-19 13:55:40 +0200206 <to
207 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
sebdetb328b372019-05-08 15:36:55 +0200208 <to uri="direct:load-loop" />
209 <to uri="direct:get-status-from-policy" />
210 <to uri="direct:get-status-from-dcae" />
xg353y7e8938e2019-05-03 13:23:40 +0200211 <log
212 loggingLevel="INFO"
sebdetb328b372019-05-08 15:36:55 +0200213 message="Policy deployment status: ${exchangeProperty[policyStatus]}"></log>
xg353y39d82de2019-04-26 13:26:25 +0200214 <choice>
xg353y39d82de2019-04-26 13:26:25 +0200215 <when>
216 <simple> ${exchangeProperty[policyStatus]} == 'SUBMITTED' and
217 ${exchangeProperty[dcaeStatus]} == 'NOT_DEPLOYED'
218 </simple>
sebdetb328b372019-05-08 15:36:55 +0200219 <to uri="direct:deploy-closedloop" />
xg353y39d82de2019-04-26 13:26:25 +0200220 </when>
221 <otherwise>
222 <log
223 loggingLevel="INFO"
224 message="Closed Loop is in state ${exchangeProperty[policyStatus]}, it can only be deployed when in state SUBMIT" />
225 <to
226 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]})" />
227 </otherwise>
228 </choice>
sebdetb328b372019-05-08 15:36:55 +0200229 <log
230 loggingLevel="INFO"
231 message="DEPLOY request successfully executed for loop: ${header.loopName}" />
232 <to
233 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200234 <to
235 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200236 <doCatch>
237 <exception>java.lang.Exception</exception>
238 <handled>
239 <constant>false</constant>
240 </handled>
241 <to
242 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
xg353y39d82de2019-04-26 13:26:25 +0200243 <log
244 loggingLevel="ERROR"
sebdetb328b372019-05-08 15:36:55 +0200245 message="DEPLOY request failed for loop: ${header.loopName}" />
xg353y39d82de2019-04-26 13:26:25 +0200246 <to
sebdetb328b372019-05-08 15:36:55 +0200247 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
sebdet338c2182019-04-25 12:33:31 +0200248 </doCatch>
249 </doTry>
sebdetdfa86ca2019-04-05 15:15:31 +0200250 </route>
251 </put>
252 <put
253 uri="/v2/loop/undeployLoop/{loopName}"
254 outType="org.onap.clamp.loop.Loop"
255 produces="application/json">
256 <route>
sebdet373b07b2019-04-26 12:04:26 +0200257 <removeHeaders
258 pattern="*"
259 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200260 <doTry>
sebdet338c2182019-04-25 12:33:31 +0200261 <to
xg353y9ac30702019-04-19 13:55:40 +0200262 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Undeploy the closed loop')" />
263 <to
264 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
sebdetb328b372019-05-08 15:36:55 +0200265 <to uri="direct:load-loop" />
266 <to uri="direct:get-status-from-dcae" />
xg353y39d82de2019-04-26 13:26:25 +0200267 <choice>
268 <when>
269 <simple> ${exchangeProperty[dcaeStatus]} == 'DEPLOYED'
270 </simple>
sebdetb328b372019-05-08 15:36:55 +0200271 <to uri="direct:undeploy-closedloop" />
xg353y39d82de2019-04-26 13:26:25 +0200272 </when>
273 <otherwise>
274 <log
275 loggingLevel="INFO"
276 message="Closed Loop is in state ${exchangeProperty[dcaeStatus]}, it can only be undeployed when in state DEPLOYED" />
277 <to
278 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]})" />
279 </otherwise>
280 </choice>
sebdetb328b372019-05-08 15:36:55 +0200281 <log
282 loggingLevel="INFO"
283 message="UNDEPLOY request successfully executed for loop: ${header.loopName}" />
284 <to
285 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200286 <to
287 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200288 <doCatch>
289 <exception>java.lang.Exception</exception>
290 <handled>
291 <constant>false</constant>
292 </handled>
293 <to
294 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
xg353y39d82de2019-04-26 13:26:25 +0200295 <log
296 loggingLevel="ERROR"
sebdetb328b372019-05-08 15:36:55 +0200297 message="UNDEPLOY request failed for loop: ${header.loopName}" />
xg353y39d82de2019-04-26 13:26:25 +0200298 <to
sebdetb328b372019-05-08 15:36:55 +0200299 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
sebdet338c2182019-04-25 12:33:31 +0200300 </doCatch>
301 </doTry>
sebdetdfa86ca2019-04-05 15:15:31 +0200302 </route>
303 </put>
sebdet667cb722019-04-11 02:07:44 +0200304 <put
sebdet1efe60f2019-04-11 17:58:36 +0200305 uri="/v2/loop/stop/{loopName}"
306 outType="org.onap.clamp.loop.Loop"
307 produces="application/json">
308 <route>
sebdet373b07b2019-04-26 12:04:26 +0200309 <removeHeaders
310 pattern="*"
311 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200312 <doTry>
313 <log
314 loggingLevel="INFO"
315 message="Receive STOP request for loop: ${header.loopName}" />
sebdet338c2182019-04-25 12:33:31 +0200316 <to
xg353y9ac30702019-04-19 13:55:40 +0200317 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog('Stop the closed loop')" />
318 <to
319 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
320 <to uri="direct:load-loop" />
sebdet373b07b2019-04-26 12:04:26 +0200321 <to uri="direct:remove-all-policy-from-active-pdp-group" />
xg353y9ac30702019-04-19 13:55:40 +0200322 <log
323 loggingLevel="INFO"
sebdetb328b372019-05-08 15:36:55 +0200324 message="STOP request successfully executed for loop: ${header.loopName}" />
xg353y9ac30702019-04-19 13:55:40 +0200325 <to
sebdet338c2182019-04-25 12:33:31 +0200326 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200327 <to
xg353y9ac30702019-04-19 13:55:40 +0200328 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200329 <doCatch>
330 <exception>java.lang.Exception</exception>
331 <handled>
332 <constant>false</constant>
333 </handled>
334 <to
335 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
sebdet373b07b2019-04-26 12:04:26 +0200336 <log
337 loggingLevel="ERROR"
338 message="STOP request failed for loop: $${header.loopName}" />
339 <to
sebdet584cc4a2019-05-03 14:32:53 +0200340 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 +0200341 </doCatch>
342 </doTry>
sebdet1efe60f2019-04-11 17:58:36 +0200343 </route>
sebdet1efe60f2019-04-11 17:58:36 +0200344 </put>
345 <put
346 uri="/v2/loop/start/{loopName}"
347 outType="org.onap.clamp.loop.Loop"
348 produces="application/json">
349 <route>
sebdet373b07b2019-04-26 12:04:26 +0200350 <removeHeaders
351 pattern="*"
352 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200353 <doTry>
354 <log
355 loggingLevel="INFO"
356 message="Receive START request for loop: ${header.loopName}" />
sebdet338c2182019-04-25 12:33:31 +0200357 <to
xg353y9ac30702019-04-19 13:55:40 +0200358 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog('Start the closed loop')" />
359 <to
360 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
361 <to uri="direct:load-loop" />
sebdet338c2182019-04-25 12:33:31 +0200362
xg353y9ac30702019-04-19 13:55:40 +0200363
sebdet373b07b2019-04-26 12:04:26 +0200364 <to uri="direct:add-all-to-active-pdp-group" />
xg353y9ac30702019-04-19 13:55:40 +0200365 <log
366 loggingLevel="INFO"
sebdet373b07b2019-04-26 12:04:26 +0200367 message="START request successfully executed for loop: ${header.loopName}" />
xg353y9ac30702019-04-19 13:55:40 +0200368 <to
sebdet338c2182019-04-25 12:33:31 +0200369 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200370 <to
xg353y9ac30702019-04-19 13:55:40 +0200371 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200372 <doCatch>
373 <exception>java.lang.Exception</exception>
374 <handled>
375 <constant>false</constant>
376 </handled>
377 <to
378 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
sebdet373b07b2019-04-26 12:04:26 +0200379 <log
380 loggingLevel="ERROR"
381 message="START request failed for loop: ${header.loopName}" />
382 <to
sebdet584cc4a2019-05-03 14:32:53 +0200383 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 +0200384 </doCatch>
385 </doTry>
sebdet1efe60f2019-04-11 17:58:36 +0200386 </route>
sebdet1efe60f2019-04-11 17:58:36 +0200387 </put>
388 <put
sebdet667cb722019-04-11 02:07:44 +0200389 uri="/v2/loop/submit/{loopName}"
390 outType="org.onap.clamp.loop.Loop"
391 produces="application/json">
sebdetdfa86ca2019-04-05 15:15:31 +0200392 <route>
sebdet373b07b2019-04-26 12:04:26 +0200393 <removeHeaders
394 pattern="*"
395 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200396 <doTry>
sebdet919ef9d2019-04-08 18:32:26 +0200397 <log
398 loggingLevel="INFO"
xg353y9ac30702019-04-19 13:55:40 +0200399 message="Receive SUBMIT request for loop: ${header.loopName}" />
sebdet338c2182019-04-25 12:33:31 +0200400 <to
401 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Submit the closed loop')" />
xg353y9ac30702019-04-19 13:55:40 +0200402 <to
403 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
404 <to uri="direct:load-loop" />
405 <to
sebdet338c2182019-04-25 12:33:31 +0200406 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive SUBMIT request','INFO',${exchangeProperty[loopObject]})" />
407 <setProperty propertyName="raiseHttpExceptionFlag">
sebdetdfa86ca2019-04-05 15:15:31 +0200408 <simple resultType="java.lang.Boolean">false</simple>
sebdet338c2182019-04-25 12:33:31 +0200409 </setProperty>
sebdet373b07b2019-04-26 12:04:26 +0200410 <to uri="direct:remove-all-policy-from-active-pdp-group" />
sebdet919ef9d2019-04-08 18:32:26 +0200411 <log
412 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200413 message="Processing all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}" />
sebdet919ef9d2019-04-08 18:32:26 +0200414 <split>
sebdet338c2182019-04-25 12:33:31 +0200415 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
sebdet919ef9d2019-04-08 18:32:26 +0200416 </simple>
sebdet338c2182019-04-25 12:33:31 +0200417 <setProperty propertyName="microServicePolicy">
sebdet919ef9d2019-04-08 18:32:26 +0200418 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200419 </setProperty>
sebdet919ef9d2019-04-08 18:32:26 +0200420 <log
421 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200422 message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
423 <setProperty propertyName="raiseHttpExceptionFlag">
sebdet919ef9d2019-04-08 18:32:26 +0200424 <simple resultType="java.lang.Boolean">false</simple>
sebdet338c2182019-04-25 12:33:31 +0200425 </setProperty>
sebdet373b07b2019-04-26 12:04:26 +0200426 <to uri="direct:delete-micro-service-policy" />
427 <to uri="direct:create-micro-service-policy" />
sebdet919ef9d2019-04-08 18:32:26 +0200428 </split>
xg353y9ac30702019-04-19 13:55:40 +0200429 <log
430 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200431 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
xg353y9ac30702019-04-19 13:55:40 +0200432 <split>
sebdet338c2182019-04-25 12:33:31 +0200433 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
xg353y9ac30702019-04-19 13:55:40 +0200434 </simple>
sebdet338c2182019-04-25 12:33:31 +0200435 <setProperty propertyName="operationalPolicy">
xg353y9ac30702019-04-19 13:55:40 +0200436 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200437 </setProperty>
xg353y9ac30702019-04-19 13:55:40 +0200438 <log
439 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200440 message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
441 <setProperty propertyName="raiseHttpExceptionFlag">
xg353y9ac30702019-04-19 13:55:40 +0200442 <simple resultType="java.lang.Boolean">false</simple>
sebdet338c2182019-04-25 12:33:31 +0200443 </setProperty>
sebdet667cb722019-04-11 02:07:44 +0200444
sebdet373b07b2019-04-26 12:04:26 +0200445 <to uri="direct:delete-operational-policy" />
446 <to uri="direct:create-operational-policy" />
sebdet338c2182019-04-25 12:33:31 +0200447
xg353y9ac30702019-04-19 13:55:40 +0200448 <log
449 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200450 message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
xg353y9ac30702019-04-19 13:55:40 +0200451 <split>
sebdet338c2182019-04-25 12:33:31 +0200452 <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
xg353y9ac30702019-04-19 13:55:40 +0200453 </simple>
sebdet338c2182019-04-25 12:33:31 +0200454 <setProperty propertyName="guardPolicy">
xg353y9ac30702019-04-19 13:55:40 +0200455 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200456 </setProperty>
xg353y9ac30702019-04-19 13:55:40 +0200457 <log
458 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200459 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
xg353y9ac30702019-04-19 13:55:40 +0200460
sebdet338c2182019-04-25 12:33:31 +0200461 <setProperty propertyName="raiseHttpExceptionFlag">
xg353y9ac30702019-04-19 13:55:40 +0200462 <simple resultType="java.lang.Boolean">false</simple>
sebdet338c2182019-04-25 12:33:31 +0200463 </setProperty>
sebdet373b07b2019-04-26 12:04:26 +0200464 <to uri="direct:delete-guard-policy" />
465 <to uri="direct:create-guard-policy" />
xg353y9ac30702019-04-19 13:55:40 +0200466 </split>
467 </split>
sebdet338c2182019-04-25 12:33:31 +0200468
sebdet373b07b2019-04-26 12:04:26 +0200469 <to uri="direct:add-all-to-active-pdp-group" />
xg353y9ac30702019-04-19 13:55:40 +0200470
471 <log
472 loggingLevel="INFO"
sebdet373b07b2019-04-26 12:04:26 +0200473 message="SUBMIT request successfully executed for loop: ${header.loopName}" />
xg353y9ac30702019-04-19 13:55:40 +0200474 <to
sebdet338c2182019-04-25 12:33:31 +0200475 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200476 <to
xg353y9ac30702019-04-19 13:55:40 +0200477 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200478 <doCatch>
479 <exception>java.lang.Exception</exception>
480 <handled>
481 <constant>false</constant>
482 </handled>
483 <to
484 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
sebdet373b07b2019-04-26 12:04:26 +0200485 <log
486 loggingLevel="ERROR"
487 message="SUBMIT request failed for loop: ${header.loopName}" />
488 <to
sebdet584cc4a2019-05-03 14:32:53 +0200489 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 +0200490 </doCatch>
491 </doTry>
sebdetdfa86ca2019-04-05 15:15:31 +0200492 </route>
493 </put>
sebdet919ef9d2019-04-08 18:32:26 +0200494 <put uri="/v2/loop/delete/{loopName}">
sebdetdfa86ca2019-04-05 15:15:31 +0200495 <route>
sebdet373b07b2019-04-26 12:04:26 +0200496 <removeHeaders
497 pattern="*"
498 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200499 <doTry>
sebdetcd64cc42019-04-10 14:07:35 +0200500 <log
501 loggingLevel="INFO"
xg353y9ac30702019-04-19 13:55:40 +0200502 message="Receive DELETE request for loop: ${header.loopName}" />
sebdet338c2182019-04-25 12:33:31 +0200503 <to
xg353y9ac30702019-04-19 13:55:40 +0200504 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog('Delete the closed loop')" />
505 <to
506 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
507 <to uri="direct:load-loop" />
508 <to
sebdet338c2182019-04-25 12:33:31 +0200509 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive DELETE request','INFO',${exchangeProperty[loopObject]})" />
sebdet373b07b2019-04-26 12:04:26 +0200510 <to uri="direct:remove-all-policy-from-active-pdp-group" />
sebdetcd64cc42019-04-10 14:07:35 +0200511 <split>
sebdet338c2182019-04-25 12:33:31 +0200512 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
sebdetcd64cc42019-04-10 14:07:35 +0200513 </simple>
sebdet338c2182019-04-25 12:33:31 +0200514 <setProperty propertyName="microServicePolicy">
sebdetcd64cc42019-04-10 14:07:35 +0200515 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200516 </setProperty>
sebdetcd64cc42019-04-10 14:07:35 +0200517 <log
518 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200519 message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
sebdet373b07b2019-04-26 12:04:26 +0200520 <to uri="direct:delete-micro-service-policy" />
sebdetcd64cc42019-04-10 14:07:35 +0200521 </split>
xg353y9ac30702019-04-19 13:55:40 +0200522
523 <log
524 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200525 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
xg353y9ac30702019-04-19 13:55:40 +0200526 <split>
sebdet338c2182019-04-25 12:33:31 +0200527 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
xg353y9ac30702019-04-19 13:55:40 +0200528 </simple>
sebdet338c2182019-04-25 12:33:31 +0200529 <setProperty propertyName="operationalPolicy">
xg353y9ac30702019-04-19 13:55:40 +0200530 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200531 </setProperty>
xg353y9ac30702019-04-19 13:55:40 +0200532 <log
533 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200534 message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
sebdet373b07b2019-04-26 12:04:26 +0200535 <to uri="direct:delete-operational-policy" />
xg353y9ac30702019-04-19 13:55:40 +0200536 <log
537 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200538 message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
xg353y9ac30702019-04-19 13:55:40 +0200539 <split>
sebdet338c2182019-04-25 12:33:31 +0200540 <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
xg353y9ac30702019-04-19 13:55:40 +0200541 </simple>
sebdet338c2182019-04-25 12:33:31 +0200542 <setProperty propertyName="guardPolicy">
xg353y9ac30702019-04-19 13:55:40 +0200543 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200544 </setProperty>
xg353y9ac30702019-04-19 13:55:40 +0200545 <log
546 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200547 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
sebdet373b07b2019-04-26 12:04:26 +0200548 <to uri="direct:delete-guard-policy" />
xg353y9ac30702019-04-19 13:55:40 +0200549 </split>
550 </split>
551 <to
552 uri="bean:org.onap.clamp.loop.log.LoopService?method=deleteLoop(${header.loopName})" />
553 <log
554 loggingLevel="INFO"
sebdet373b07b2019-04-26 12:04:26 +0200555 message="DELETE request successfully executed for loop: ${header.loopName}" />
xg353y9ac30702019-04-19 13:55:40 +0200556 <to
sebdet338c2182019-04-25 12:33:31 +0200557 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200558 <to
559 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200560 <doCatch>
561 <exception>java.lang.Exception</exception>
562 <handled>
563 <constant>false</constant>
564 </handled>
565 <to
566 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
sebdet373b07b2019-04-26 12:04:26 +0200567 <log
568 loggingLevel="ERROR"
569 message="DELETE request failed for loop: ${header.loopName}" />
570 <to
sebdet584cc4a2019-05-03 14:32:53 +0200571 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 +0200572 </doCatch>
573 </doTry>
sebdetdfa86ca2019-04-05 15:15:31 +0200574 </route>
575 </put>
xg353y39d82de2019-04-26 13:26:25 +0200576 <get
577 uri="/v2/loop/getstatus/{loopName}"
578 outType="org.onap.clamp.loop.Loop"
579 produces="application/json">
580 <route>
sebdetb328b372019-05-08 15:36:55 +0200581 <removeHeaders
582 pattern="*"
583 excludePattern="loopName" />
xg353y39d82de2019-04-26 13:26:25 +0200584 <doTry>
585 <log
586 loggingLevel="INFO"
587 message="Get current status for loop: ${header.loopName}" />
588 <to
589 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get the closed loop status')" />
590 <to
591 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
592 <to uri="direct:load-loop" />
593 <to
594 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive GET STATUS request','INFO',${exchangeProperty[loopObject]})" />
595 <setProperty propertyName="raiseHttpExceptionFlag">
596 <simple resultType="java.lang.Boolean">false</simple>
597 </setProperty>
598 <to uri="direct:get-status-from-policy" />
599 <to uri="direct:get-status-from-dcae" />
600 <to
xg353y7e8938e2019-05-03 13:23:40 +0200601 uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopStatus(${exchangeProperty[loopObject]},${exchangeProperty[policyStatus]}, ${exchangeProperty[dcaeStatus]})" />
xg353y39d82de2019-04-26 13:26:25 +0200602 <log
603 loggingLevel="INFO"
xg353y7e8938e2019-05-03 13:23:40 +0200604 message="Get Status request successfully executed. The new state is: ${body}" />
xg353y39d82de2019-04-26 13:26:25 +0200605 <to
606 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request successfully executed','INFO',${exchangeProperty[loopObject]})" />
607 <to
608 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
609 <to
610 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
611 <doCatch>
612 <exception>java.lang.Exception</exception>
613 <handled>
614 <constant>false</constant>
615 </handled>
616 <to
617 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
618 <log
619 loggingLevel="ERROR"
620 message="Get Status request failed for loop: ${header.loopName}" />
621 <to
sebdetb328b372019-05-08 15:36:55 +0200622 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
xg353y39d82de2019-04-26 13:26:25 +0200623 </doCatch>
624 </doTry>
625 </route>
626 </get>
sebdetdfa86ca2019-04-05 15:15:31 +0200627 </rest>
Krysiak Adam5f14c7a2019-03-01 15:32:19 +0100628</rests>