blob: da856e9477807a55449dfc8d9ba5ebda9a4ed6cd [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
sebdet0e9310b2019-05-13 18:06:33 +020011 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Loop')" />
xg353y9ac30702019-04-19 13:55:40 +020012 <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
sebdet0e9310b2019-05-13 18:06:33 +020039 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Loop')" />
xg353y9ac30702019-04-19 13:55:40 +020040 <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>
sebdet0e9310b2019-05-13 18:06:33 +0200204 <log
205 loggingLevel="INFO"
206 message="DCAE DEPLOY request for loop: ${header.loopName}" />
sebdet338c2182019-04-25 12:33:31 +0200207 <to
sebdet0e9310b2019-05-13 18:06:33 +0200208 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DCAE DEPLOY request')" />
xg353y9ac30702019-04-19 13:55:40 +0200209 <to
210 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
sebdetb328b372019-05-08 15:36:55 +0200211 <to uri="direct:load-loop" />
sebdet0e9310b2019-05-13 18:06:33 +0200212 <to
213 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DCAE DEPLOY request','INFO',${exchangeProperty[loopObject]})" />
214
sebdetb328b372019-05-08 15:36:55 +0200215 <to uri="direct:get-status-from-policy" />
216 <to uri="direct:get-status-from-dcae" />
xg353y7e8938e2019-05-03 13:23:40 +0200217 <log
218 loggingLevel="INFO"
sebdetb328b372019-05-08 15:36:55 +0200219 message="Policy deployment status: ${exchangeProperty[policyStatus]}"></log>
xg353y39d82de2019-04-26 13:26:25 +0200220 <choice>
xg353y39d82de2019-04-26 13:26:25 +0200221 <when>
222 <simple> ${exchangeProperty[policyStatus]} == 'SUBMITTED' and
223 ${exchangeProperty[dcaeStatus]} == 'NOT_DEPLOYED'
224 </simple>
sebdetaa7fd8d2019-05-09 16:50:17 +0200225 <to uri="direct:deploy-loop" />
xg353y39d82de2019-04-26 13:26:25 +0200226 </when>
227 <otherwise>
228 <log
229 loggingLevel="INFO"
Determe, Sebastien (sd378r)4a999562019-05-29 17:41:44 +0200230 message="POLICY status ${exchangeProperty[policyStatus]}/DCAE status ${exchangeProperty[dcaeStatus]}, DCAE deployment will be started anyway" />
xg353y39d82de2019-04-26 13:26:25 +0200231 <to
Determe, Sebastien (sd378r)4a999562019-05-29 17:41:44 +0200232 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('POLICY status ${exchangeProperty[policyStatus]}/DCAE status ${exchangeProperty[dcaeStatus]}, DCAE deployment will be started anyway','ERROR',${exchangeProperty[loopObject]})" />
233 <to uri="direct:deploy-loop" />
xg353y39d82de2019-04-26 13:26:25 +0200234 </otherwise>
235 </choice>
sebdetb328b372019-05-08 15:36:55 +0200236 <log
237 loggingLevel="INFO"
238 message="DEPLOY request successfully executed for loop: ${header.loopName}" />
239 <to
240 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200241 <to
242 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200243 <doCatch>
244 <exception>java.lang.Exception</exception>
245 <handled>
246 <constant>false</constant>
247 </handled>
248 <to
249 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
xg353y39d82de2019-04-26 13:26:25 +0200250 <log
251 loggingLevel="ERROR"
sebdetb328b372019-05-08 15:36:55 +0200252 message="DEPLOY request failed for loop: ${header.loopName}" />
xg353y39d82de2019-04-26 13:26:25 +0200253 <to
sebdetb328b372019-05-08 15:36:55 +0200254 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 +0200255 </doCatch>
256 </doTry>
sebdetdfa86ca2019-04-05 15:15:31 +0200257 </route>
258 </put>
259 <put
260 uri="/v2/loop/undeployLoop/{loopName}"
261 outType="org.onap.clamp.loop.Loop"
262 produces="application/json">
263 <route>
sebdet373b07b2019-04-26 12:04:26 +0200264 <removeHeaders
265 pattern="*"
266 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200267 <doTry>
sebdet0e9310b2019-05-13 18:06:33 +0200268 <log
269 loggingLevel="INFO"
270 message="DCAE UNDEPLOY request for loop: ${header.loopName}" />
sebdet338c2182019-04-25 12:33:31 +0200271 <to
sebdet0e9310b2019-05-13 18:06:33 +0200272 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DCAE UNDEPLOY request')" />
xg353y9ac30702019-04-19 13:55:40 +0200273 <to
274 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
sebdetb328b372019-05-08 15:36:55 +0200275 <to uri="direct:load-loop" />
sebdet0e9310b2019-05-13 18:06:33 +0200276 <to
277 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DCAE UNDEPLOY request','INFO',${exchangeProperty[loopObject]})" />
sebdetb328b372019-05-08 15:36:55 +0200278 <to uri="direct:get-status-from-dcae" />
xg353y39d82de2019-04-26 13:26:25 +0200279 <choice>
280 <when>
sebdet2fe9ae12019-05-09 18:37:40 +0200281 <simple> ${exchangeProperty[dcaeStatus]} == 'DEPLOYED' or ${exchangeProperty[dcaeStatus]} == 'IN_ERROR' or ${exchangeProperty[dcaeStatus]} == 'PROCESSING'
xg353y39d82de2019-04-26 13:26:25 +0200282 </simple>
sebdetaa7fd8d2019-05-09 16:50:17 +0200283 <to uri="direct:undeploy-loop" />
xg353y39d82de2019-04-26 13:26:25 +0200284 </when>
285 <otherwise>
286 <log
287 loggingLevel="INFO"
sebdet0e9310b2019-05-13 18:06:33 +0200288 message="Loop is in state ${exchangeProperty[dcaeStatus]}, it can only be undeployed when in state DEPLOYED/IN_ERROR/PROCESSING" />
xg353y39d82de2019-04-26 13:26:25 +0200289 <to
sebdet0e9310b2019-05-13 18:06:33 +0200290 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Loop is in state ${exchangeProperty[dcaeStatus]}, it can only be deployed when in state DEPLOYED','ERROR',${exchangeProperty[loopObject]})" />
xg353y39d82de2019-04-26 13:26:25 +0200291 </otherwise>
292 </choice>
sebdetb328b372019-05-08 15:36:55 +0200293 <log
294 loggingLevel="INFO"
295 message="UNDEPLOY request successfully executed for loop: ${header.loopName}" />
296 <to
297 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200298 <to
299 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200300 <doCatch>
301 <exception>java.lang.Exception</exception>
302 <handled>
303 <constant>false</constant>
304 </handled>
305 <to
306 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
xg353y39d82de2019-04-26 13:26:25 +0200307 <log
308 loggingLevel="ERROR"
sebdetb328b372019-05-08 15:36:55 +0200309 message="UNDEPLOY request failed for loop: ${header.loopName}" />
xg353y39d82de2019-04-26 13:26:25 +0200310 <to
sebdetb328b372019-05-08 15:36:55 +0200311 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 +0200312 </doCatch>
313 </doTry>
sebdetdfa86ca2019-04-05 15:15:31 +0200314 </route>
315 </put>
sebdet667cb722019-04-11 02:07:44 +0200316 <put
sebdet1efe60f2019-04-11 17:58:36 +0200317 uri="/v2/loop/stop/{loopName}"
318 outType="org.onap.clamp.loop.Loop"
319 produces="application/json">
320 <route>
sebdet373b07b2019-04-26 12:04:26 +0200321 <removeHeaders
322 pattern="*"
323 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200324 <doTry>
325 <log
326 loggingLevel="INFO"
sebdet0e9310b2019-05-13 18:06:33 +0200327 message="STOP request for loop: ${header.loopName}" />
sebdet338c2182019-04-25 12:33:31 +0200328 <to
sebdet0e9310b2019-05-13 18:06:33 +0200329 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'STOP request')" />
xg353y9ac30702019-04-19 13:55:40 +0200330 <to
331 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
332 <to uri="direct:load-loop" />
sebdet0e9310b2019-05-13 18:06:33 +0200333 <to
334 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request','INFO',${exchangeProperty[loopObject]})" />
335
sebdet373b07b2019-04-26 12:04:26 +0200336 <to uri="direct:remove-all-policy-from-active-pdp-group" />
xg353y9ac30702019-04-19 13:55:40 +0200337 <log
338 loggingLevel="INFO"
sebdetb328b372019-05-08 15:36:55 +0200339 message="STOP request successfully executed for loop: ${header.loopName}" />
xg353y9ac30702019-04-19 13:55:40 +0200340 <to
sebdet338c2182019-04-25 12:33:31 +0200341 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200342 <to
xg353y9ac30702019-04-19 13:55:40 +0200343 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200344 <doCatch>
345 <exception>java.lang.Exception</exception>
346 <handled>
347 <constant>false</constant>
348 </handled>
349 <to
350 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
sebdet373b07b2019-04-26 12:04:26 +0200351 <log
352 loggingLevel="ERROR"
353 message="STOP request failed for loop: $${header.loopName}" />
354 <to
sebdet584cc4a2019-05-03 14:32:53 +0200355 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 +0200356 </doCatch>
357 </doTry>
sebdet1efe60f2019-04-11 17:58:36 +0200358 </route>
sebdet1efe60f2019-04-11 17:58:36 +0200359 </put>
360 <put
sebdet2fcc09a2019-05-13 10:24:06 +0200361 uri="/v2/loop/restart/{loopName}"
sebdet1efe60f2019-04-11 17:58:36 +0200362 outType="org.onap.clamp.loop.Loop"
363 produces="application/json">
364 <route>
sebdet373b07b2019-04-26 12:04:26 +0200365 <removeHeaders
366 pattern="*"
367 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200368 <doTry>
369 <log
370 loggingLevel="INFO"
sebdet0e9310b2019-05-13 18:06:33 +0200371 message="RESTART request for loop: ${header.loopName}" />
sebdet338c2182019-04-25 12:33:31 +0200372 <to
sebdet0e9310b2019-05-13 18:06:33 +0200373 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'RESTART request')" />
xg353y9ac30702019-04-19 13:55:40 +0200374 <to
375 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
376 <to uri="direct:load-loop" />
sebdet338c2182019-04-25 12:33:31 +0200377
sebdet0e9310b2019-05-13 18:06:33 +0200378 <to
379 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200380
sebdet373b07b2019-04-26 12:04:26 +0200381 <to uri="direct:add-all-to-active-pdp-group" />
xg353y9ac30702019-04-19 13:55:40 +0200382 <log
383 loggingLevel="INFO"
sebdet2fcc09a2019-05-13 10:24:06 +0200384 message="RESTART request successfully executed for loop: ${header.loopName}" />
xg353y9ac30702019-04-19 13:55:40 +0200385 <to
sebdet2fcc09a2019-05-13 10:24:06 +0200386 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200387 <to
xg353y9ac30702019-04-19 13:55:40 +0200388 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200389 <doCatch>
390 <exception>java.lang.Exception</exception>
391 <handled>
392 <constant>false</constant>
393 </handled>
394 <to
395 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
sebdet373b07b2019-04-26 12:04:26 +0200396 <log
397 loggingLevel="ERROR"
sebdet2fcc09a2019-05-13 10:24:06 +0200398 message="RESTART request failed for loop: ${header.loopName}" />
sebdet373b07b2019-04-26 12:04:26 +0200399 <to
sebdet2fcc09a2019-05-13 10:24:06 +0200400 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request failed, Error reported: ${exception}','INFO',${exchangeProperty[loopObject]})" />
sebdet338c2182019-04-25 12:33:31 +0200401 </doCatch>
402 </doTry>
sebdet1efe60f2019-04-11 17:58:36 +0200403 </route>
sebdet1efe60f2019-04-11 17:58:36 +0200404 </put>
405 <put
sebdet667cb722019-04-11 02:07:44 +0200406 uri="/v2/loop/submit/{loopName}"
407 outType="org.onap.clamp.loop.Loop"
408 produces="application/json">
sebdetdfa86ca2019-04-05 15:15:31 +0200409 <route>
sebdet373b07b2019-04-26 12:04:26 +0200410 <removeHeaders
411 pattern="*"
412 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200413 <doTry>
sebdet919ef9d2019-04-08 18:32:26 +0200414 <log
415 loggingLevel="INFO"
sebdet0e9310b2019-05-13 18:06:33 +0200416 message="POLICY SUBMIT request for loop: ${header.loopName}" />
sebdet338c2182019-04-25 12:33:31 +0200417 <to
sebdet0e9310b2019-05-13 18:06:33 +0200418 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'POLICY SUBMIT request')" />
xg353y9ac30702019-04-19 13:55:40 +0200419 <to
420 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
421 <to uri="direct:load-loop" />
422 <to
sebdet0e9310b2019-05-13 18:06:33 +0200423 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('POLICY SUBMIT request','INFO',${exchangeProperty[loopObject]})" />
sebdet338c2182019-04-25 12:33:31 +0200424 <setProperty propertyName="raiseHttpExceptionFlag">
sebdetdfa86ca2019-04-05 15:15:31 +0200425 <simple resultType="java.lang.Boolean">false</simple>
sebdet338c2182019-04-25 12:33:31 +0200426 </setProperty>
sebdet373b07b2019-04-26 12:04:26 +0200427 <to uri="direct:remove-all-policy-from-active-pdp-group" />
sebdet919ef9d2019-04-08 18:32:26 +0200428 <log
429 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200430 message="Processing all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}" />
sebdet919ef9d2019-04-08 18:32:26 +0200431 <split>
sebdet338c2182019-04-25 12:33:31 +0200432 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
sebdet919ef9d2019-04-08 18:32:26 +0200433 </simple>
sebdet338c2182019-04-25 12:33:31 +0200434 <setProperty propertyName="microServicePolicy">
sebdet919ef9d2019-04-08 18:32:26 +0200435 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200436 </setProperty>
sebdet919ef9d2019-04-08 18:32:26 +0200437 <log
438 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200439 message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
440 <setProperty propertyName="raiseHttpExceptionFlag">
sebdet919ef9d2019-04-08 18:32:26 +0200441 <simple resultType="java.lang.Boolean">false</simple>
sebdet338c2182019-04-25 12:33:31 +0200442 </setProperty>
sebdet373b07b2019-04-26 12:04:26 +0200443 <to uri="direct:delete-micro-service-policy" />
444 <to uri="direct:create-micro-service-policy" />
sebdet919ef9d2019-04-08 18:32:26 +0200445 </split>
xg353y9ac30702019-04-19 13:55:40 +0200446 <log
447 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200448 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
xg353y9ac30702019-04-19 13:55:40 +0200449 <split>
sebdet338c2182019-04-25 12:33:31 +0200450 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
xg353y9ac30702019-04-19 13:55:40 +0200451 </simple>
sebdet338c2182019-04-25 12:33:31 +0200452 <setProperty propertyName="operationalPolicy">
xg353y9ac30702019-04-19 13:55:40 +0200453 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200454 </setProperty>
xg353y9ac30702019-04-19 13:55:40 +0200455 <log
456 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200457 message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
458 <setProperty propertyName="raiseHttpExceptionFlag">
xg353y9ac30702019-04-19 13:55:40 +0200459 <simple resultType="java.lang.Boolean">false</simple>
sebdet338c2182019-04-25 12:33:31 +0200460 </setProperty>
sebdet667cb722019-04-11 02:07:44 +0200461
sebdet373b07b2019-04-26 12:04:26 +0200462 <to uri="direct:delete-operational-policy" />
463 <to uri="direct:create-operational-policy" />
sebdet338c2182019-04-25 12:33:31 +0200464
xg353y9ac30702019-04-19 13:55:40 +0200465 <log
466 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200467 message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
xg353y9ac30702019-04-19 13:55:40 +0200468 <split>
sebdet338c2182019-04-25 12:33:31 +0200469 <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
xg353y9ac30702019-04-19 13:55:40 +0200470 </simple>
sebdet338c2182019-04-25 12:33:31 +0200471 <setProperty propertyName="guardPolicy">
xg353y9ac30702019-04-19 13:55:40 +0200472 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200473 </setProperty>
xg353y9ac30702019-04-19 13:55:40 +0200474 <log
475 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200476 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
xg353y9ac30702019-04-19 13:55:40 +0200477
sebdet338c2182019-04-25 12:33:31 +0200478 <setProperty propertyName="raiseHttpExceptionFlag">
xg353y9ac30702019-04-19 13:55:40 +0200479 <simple resultType="java.lang.Boolean">false</simple>
sebdet338c2182019-04-25 12:33:31 +0200480 </setProperty>
sebdet373b07b2019-04-26 12:04:26 +0200481 <to uri="direct:delete-guard-policy" />
482 <to uri="direct:create-guard-policy" />
xg353y9ac30702019-04-19 13:55:40 +0200483 </split>
484 </split>
sebdet338c2182019-04-25 12:33:31 +0200485
sebdet373b07b2019-04-26 12:04:26 +0200486 <to uri="direct:add-all-to-active-pdp-group" />
xg353y9ac30702019-04-19 13:55:40 +0200487
488 <log
489 loggingLevel="INFO"
sebdet373b07b2019-04-26 12:04:26 +0200490 message="SUBMIT request successfully executed for loop: ${header.loopName}" />
xg353y9ac30702019-04-19 13:55:40 +0200491 <to
sebdet338c2182019-04-25 12:33:31 +0200492 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200493 <to
xg353y9ac30702019-04-19 13:55:40 +0200494 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200495 <doCatch>
496 <exception>java.lang.Exception</exception>
497 <handled>
498 <constant>false</constant>
499 </handled>
500 <to
501 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
sebdet373b07b2019-04-26 12:04:26 +0200502 <log
503 loggingLevel="ERROR"
504 message="SUBMIT request failed for loop: ${header.loopName}" />
505 <to
sebdet584cc4a2019-05-03 14:32:53 +0200506 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 +0200507 </doCatch>
508 </doTry>
sebdetdfa86ca2019-04-05 15:15:31 +0200509 </route>
510 </put>
sebdet919ef9d2019-04-08 18:32:26 +0200511 <put uri="/v2/loop/delete/{loopName}">
sebdetdfa86ca2019-04-05 15:15:31 +0200512 <route>
sebdet373b07b2019-04-26 12:04:26 +0200513 <removeHeaders
514 pattern="*"
515 excludePattern="loopName" />
xg353y9ac30702019-04-19 13:55:40 +0200516 <doTry>
sebdetcd64cc42019-04-10 14:07:35 +0200517 <log
518 loggingLevel="INFO"
sebdet0e9310b2019-05-13 18:06:33 +0200519 message="DELETE request for loop: ${header.loopName}" />
sebdet338c2182019-04-25 12:33:31 +0200520 <to
sebdet0e9310b2019-05-13 18:06:33 +0200521 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'DELETE request')" />
xg353y9ac30702019-04-19 13:55:40 +0200522 <to
523 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
524 <to uri="direct:load-loop" />
525 <to
sebdet0e9310b2019-05-13 18:06:33 +0200526 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request','INFO',${exchangeProperty[loopObject]})" />
sebdet373b07b2019-04-26 12:04:26 +0200527 <to uri="direct:remove-all-policy-from-active-pdp-group" />
sebdetcd64cc42019-04-10 14:07:35 +0200528 <split>
sebdet338c2182019-04-25 12:33:31 +0200529 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
sebdetcd64cc42019-04-10 14:07:35 +0200530 </simple>
sebdet338c2182019-04-25 12:33:31 +0200531 <setProperty propertyName="microServicePolicy">
sebdetcd64cc42019-04-10 14:07:35 +0200532 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200533 </setProperty>
sebdetcd64cc42019-04-10 14:07:35 +0200534 <log
535 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200536 message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
sebdet373b07b2019-04-26 12:04:26 +0200537 <to uri="direct:delete-micro-service-policy" />
sebdetcd64cc42019-04-10 14:07:35 +0200538 </split>
xg353y9ac30702019-04-19 13:55:40 +0200539
540 <log
541 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200542 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
xg353y9ac30702019-04-19 13:55:40 +0200543 <split>
sebdet338c2182019-04-25 12:33:31 +0200544 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
xg353y9ac30702019-04-19 13:55:40 +0200545 </simple>
sebdet338c2182019-04-25 12:33:31 +0200546 <setProperty propertyName="operationalPolicy">
xg353y9ac30702019-04-19 13:55:40 +0200547 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200548 </setProperty>
xg353y9ac30702019-04-19 13:55:40 +0200549 <log
550 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200551 message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
sebdet373b07b2019-04-26 12:04:26 +0200552 <to uri="direct:delete-operational-policy" />
xg353y9ac30702019-04-19 13:55:40 +0200553 <log
554 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200555 message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
xg353y9ac30702019-04-19 13:55:40 +0200556 <split>
sebdet338c2182019-04-25 12:33:31 +0200557 <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
xg353y9ac30702019-04-19 13:55:40 +0200558 </simple>
sebdet338c2182019-04-25 12:33:31 +0200559 <setProperty propertyName="guardPolicy">
xg353y9ac30702019-04-19 13:55:40 +0200560 <simple>${body}</simple>
sebdet338c2182019-04-25 12:33:31 +0200561 </setProperty>
xg353y9ac30702019-04-19 13:55:40 +0200562 <log
563 loggingLevel="INFO"
sebdet338c2182019-04-25 12:33:31 +0200564 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
sebdet373b07b2019-04-26 12:04:26 +0200565 <to uri="direct:delete-guard-policy" />
xg353y9ac30702019-04-19 13:55:40 +0200566 </split>
567 </split>
568 <to
569 uri="bean:org.onap.clamp.loop.log.LoopService?method=deleteLoop(${header.loopName})" />
570 <log
571 loggingLevel="INFO"
sebdet373b07b2019-04-26 12:04:26 +0200572 message="DELETE request successfully executed for loop: ${header.loopName}" />
xg353y9ac30702019-04-19 13:55:40 +0200573 <to
sebdet338c2182019-04-25 12:33:31 +0200574 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request successfully executed','INFO',${exchangeProperty[loopObject]})" />
xg353y9ac30702019-04-19 13:55:40 +0200575 <to
576 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
sebdet338c2182019-04-25 12:33:31 +0200577 <doCatch>
578 <exception>java.lang.Exception</exception>
579 <handled>
580 <constant>false</constant>
581 </handled>
582 <to
583 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
sebdet373b07b2019-04-26 12:04:26 +0200584 <log
585 loggingLevel="ERROR"
586 message="DELETE request failed for loop: ${header.loopName}" />
587 <to
sebdet584cc4a2019-05-03 14:32:53 +0200588 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 +0200589 </doCatch>
590 </doTry>
sebdetdfa86ca2019-04-05 15:15:31 +0200591 </route>
592 </put>
xg353y39d82de2019-04-26 13:26:25 +0200593 <get
594 uri="/v2/loop/getstatus/{loopName}"
595 outType="org.onap.clamp.loop.Loop"
596 produces="application/json">
597 <route>
sebdetb328b372019-05-08 15:36:55 +0200598 <removeHeaders
599 pattern="*"
600 excludePattern="loopName" />
xg353y39d82de2019-04-26 13:26:25 +0200601 <doTry>
602 <log
603 loggingLevel="INFO"
sebdet0e9310b2019-05-13 18:06:33 +0200604 message="GET STATUS request for loop: ${header.loopName}" />
xg353y39d82de2019-04-26 13:26:25 +0200605 <to
sebdet0e9310b2019-05-13 18:06:33 +0200606 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET STATUS request')" />
xg353y39d82de2019-04-26 13:26:25 +0200607 <to
608 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
609 <to uri="direct:load-loop" />
610 <to
sebdet0e9310b2019-05-13 18:06:33 +0200611 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request','INFO',${exchangeProperty[loopObject]})" />
xg353y39d82de2019-04-26 13:26:25 +0200612 <setProperty propertyName="raiseHttpExceptionFlag">
613 <simple resultType="java.lang.Boolean">false</simple>
614 </setProperty>
615 <to uri="direct:get-status-from-policy" />
616 <to uri="direct:get-status-from-dcae" />
617 <to
xg353y7e8938e2019-05-03 13:23:40 +0200618 uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopStatus(${exchangeProperty[loopObject]},${exchangeProperty[policyStatus]}, ${exchangeProperty[dcaeStatus]})" />
xg353y39d82de2019-04-26 13:26:25 +0200619 <log
620 loggingLevel="INFO"
xg353y7e8938e2019-05-03 13:23:40 +0200621 message="Get Status request successfully executed. The new state is: ${body}" />
xg353y39d82de2019-04-26 13:26:25 +0200622 <to
623 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request successfully executed','INFO',${exchangeProperty[loopObject]})" />
624 <to
xg353y39d82de2019-04-26 13:26:25 +0200625 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
626 <doCatch>
627 <exception>java.lang.Exception</exception>
628 <handled>
629 <constant>false</constant>
630 </handled>
631 <to
632 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
633 <log
634 loggingLevel="ERROR"
635 message="Get Status request failed for loop: ${header.loopName}" />
636 <to
sebdetb328b372019-05-08 15:36:55 +0200637 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 +0200638 </doCatch>
xg353ybc753df2019-05-09 11:41:30 +0200639 <doFinally>
640 <to
641 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
642 </doFinally>
xg353y39d82de2019-04-26 13:26:25 +0200643 </doTry>
644 </route>
645 </get>
sebdetdfa86ca2019-04-05 15:15:31 +0200646 </rest>
Krysiak Adam5f14c7a2019-03-01 15:32:19 +0100647</rests>