blob: a116c568571ebbe3e6193b9f5424c4115e93f4fd [file] [log] [blame]
Determe, Sebastien (sd378r)7c083742018-02-14 15:31:55 +01001<routes xmlns="http://camel.apache.org/schema/spring">
sebdetdfa86ca2019-04-05 15:15:31 +02002 <route id="submit">
3 <from uri="direct:processSubmit" />
4 <choice>
5 <when>
6 <simple> ${exchangeProperty.actionCd} == 'SUBMIT' ||
7 ${exchangeProperty.actionCd} == 'RESUBMIT'
8 </simple>
9 <to
10 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
11 <to uri="bean:org.onap.clamp.clds.client.TcaPolicyDelegate" />
12 <to uri="bean:org.onap.clamp.clds.client.HolmesPolicyDelegate" />
13 <delay>
14 <constant>30000</constant>
15 </delay>
16 <to
17 uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" />
18 <to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" />
19 <to
20 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
21 </when>
22 <when>
23 <simple> ${exchangeProperty.actionCd} == 'DELETE'</simple>
24 <to
25 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
26 <to uri="bean:org.onap.clamp.clds.client.TcaPolicyDeleteDelegate" />
27 <to
28 uri="bean:org.onap.clamp.clds.client.HolmesPolicyDeleteDelegate" />
29 <delay>
30 <constant>30000</constant>
31 </delay>
32 <to
33 uri="bean:org.onap.clamp.clds.client.OperationalPolicyDeleteDelegate" />
34 <to
35 uri="bean:org.onap.clamp.clds.client.GuardPolicyDeleteDelegate" />
36 <to uri="bean:org.onap.clamp.clds.client.ModelDeleteDelegate" />
37 <to
38 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
39 </when>
40 <when>
41 <simple> ${exchangeProperty.actionCd} == 'UPDATE'</simple>
42 <to
43 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
44 <to uri="bean:org.onap.clamp.clds.client.TcaPolicyDelegate" />
45 <to uri="bean:org.onap.clamp.clds.client.HolmesPolicyDelegate" />
46 <delay>
47 <constant>30000</constant>
48 </delay>
49 <to
50 uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" />
51 <to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" />
52 <to
53 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
54 </when>
55 <when>
56 <simple> ${exchangeProperty.actionCd} == 'STOP'</simple>
57 <to
58 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
59 <to
60 uri="bean:org.onap.clamp.clds.client.OperationalPolicyDeleteDelegate" />
61 <to
62 uri="bean:org.onap.clamp.clds.client.GuardPolicyDeleteDelegate" />
63 <to
64 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
65 </when>
66 <when>
67 <simple> ${exchangeProperty.actionCd} == 'RESTART'</simple>
68 <to
69 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
70 <to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" />
71 <to
72 uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" />
73 <to
74 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
75 </when>
76 </choice>
77 </route>
sebdetdfa86ca2019-04-05 15:15:31 +020078
sebdet919ef9d2019-04-08 18:32:26 +020079 <route id="load-loop">
80 <from uri="direct:load-loop" />
sebdet667cb722019-04-11 02:07:44 +020081 <setBody>
82 <simple>${header.loopName}</simple>
83 </setBody>
sebdet338c2182019-04-25 12:33:31 +020084 <setProperty propertyName="loopObject">
sebdet919ef9d2019-04-08 18:32:26 +020085 <method
86 ref="org.onap.clamp.loop.LoopService"
87 method="getLoop" />
sebdet338c2182019-04-25 12:33:31 +020088 </setProperty>
sebdet919ef9d2019-04-08 18:32:26 +020089
90 <when>
sebdet338c2182019-04-25 12:33:31 +020091 <simple>${exchangeProperty[loopObject]} == null</simple>
sebdet919ef9d2019-04-08 18:32:26 +020092 <setHeader headerName="CamelHttpResponseCode">
93 <constant>404</constant>
94 </setHeader>
95 <log
96 loggingLevel="WARNING"
97 message="Loop not found in database: ${body}" />
98 <stop />
99 </when>
sebdet919ef9d2019-04-08 18:32:26 +0200100 </route>
sebdet338c2182019-04-25 12:33:31 +0200101
sebdet919ef9d2019-04-08 18:32:26 +0200102 <route id="create-micro-service-policy">
103 <from uri="direct:create-micro-service-policy" />
sebdet373b07b2019-04-26 12:04:26 +0200104 <doTry>
105 <log
106 loggingLevel="INFO"
107 message="Creating Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
108 <to
109 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Micro Service Policy')" />
110 <setBody>
111 <simple>${exchangeProperty[microServicePolicy].createPolicyPayload()}
112 </simple>
113 </setBody>
114 <setHeader headerName="CamelHttpMethod">
115 <constant>POST</constant>
116 </setHeader>
117 <setHeader headerName="Content-Type">
118 <constant>application/json</constant>
119 </setHeader>
120 <setHeader headerName="X-ONAP-RequestID">
121 <simple>${exchangeProperty[X-ONAP-RequestID]}
122 </simple>
123 </setHeader>
124 <setHeader headerName="X-ONAP-InvocationID">
125 <simple>${exchangeProperty[X-ONAP-InvocationID]}
126 </simple>
127 </setHeader>
128 <setHeader headerName="X-ONAP-PartnerName">
129 <simple>${exchangeProperty[X-ONAP-PartnerName]}
130 </simple>
131 </setHeader>
132 <log
133 loggingLevel="INFO"
sebdetaf8b7d72019-04-26 16:34:14 +0200134 message="Endpoint to create microservice policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies"></log>
sebdet373b07b2019-04-26 12:04:26 +0200135 <toD
sebdetaf8b7d72019-04-26 16:34:14 +0200136 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies?bridgeEndpoint=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
sebdet373b07b2019-04-26 12:04:26 +0200137 <doFinally>
138 <to uri="direct:reset-raise-http-exception-flag" />
139 <to
140 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
141 <setProperty propertyName="logMessage">
142 <simple>${exchangeProperty[microServicePolicy].getName()} creation
143 status
144 </simple>
145 </setProperty>
146 <to uri="direct:dump-loop-log-http-response" />
147 </doFinally>
148 </doTry>
sebdet919ef9d2019-04-08 18:32:26 +0200149 </route>
sebdet338c2182019-04-25 12:33:31 +0200150
sebdet919ef9d2019-04-08 18:32:26 +0200151 <route id="delete-micro-service-policy">
152 <from uri="direct:delete-micro-service-policy" />
sebdet373b07b2019-04-26 12:04:26 +0200153 <doTry>
154 <log
155 loggingLevel="INFO"
156 message="Deleting Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
157 <to
158 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Micro Service Policy')" />
sebdet667cb722019-04-11 02:07:44 +0200159 <setBody>
160 <constant>null</constant>
161 </setBody>
162 <setHeader headerName="CamelHttpMethod">
163 <constant>DELETE</constant>
164 </setHeader>
xg353y9ac30702019-04-19 13:55:40 +0200165 <setHeader headerName="X-ONAP-RequestID">
sebdet338c2182019-04-25 12:33:31 +0200166 <simple>${exchangeProperty[X-ONAP-RequestID]}
xg353y9ac30702019-04-19 13:55:40 +0200167 </simple>
168 </setHeader>
169 <setHeader headerName="X-ONAP-InvocationID">
sebdet338c2182019-04-25 12:33:31 +0200170 <simple>${exchangeProperty[X-ONAP-InvocationID]}
xg353y9ac30702019-04-19 13:55:40 +0200171 </simple>
172 </setHeader>
173 <setHeader headerName="X-ONAP-PartnerName">
sebdet338c2182019-04-25 12:33:31 +0200174 <simple>${exchangeProperty[X-ONAP-PartnerName]}
xg353y9ac30702019-04-19 13:55:40 +0200175 </simple>
176 </setHeader>
sebdet667cb722019-04-11 02:07:44 +0200177 <log
178 loggingLevel="INFO"
sebdetaf8b7d72019-04-26 16:34:14 +0200179 message="Endpoint to delete microservice policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}/versions/1.0.0"></log>
sebdet667cb722019-04-11 02:07:44 +0200180 <toD
sebdetaf8b7d72019-04-26 16:34:14 +0200181 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}/versions/1.0.0?bridgeEndpoint=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
sebdet373b07b2019-04-26 12:04:26 +0200182
183 <doFinally>
184 <to uri="direct:reset-raise-http-exception-flag" />
185 <to
186 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
187 <setProperty propertyName="logMessage">
188 <simple>${exchangeProperty[microServicePolicy].getName()} removal
189 status
190 </simple>
191 </setProperty>
192 <to uri="direct:dump-loop-log-http-response" />
193 </doFinally>
194 </doTry>
195 </route>
196
197 <route id="create-operational-policy">
198 <from uri="direct:create-operational-policy" />
199 <doTry>
200 <log
201 loggingLevel="INFO"
202 message="Creating Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
sebdet667cb722019-04-11 02:07:44 +0200203 <to
sebdet373b07b2019-04-26 12:04:26 +0200204 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Operational Policy')" />
205 <setBody>
206 <simple>${exchangeProperty[operationalPolicy].createPolicyPayload()}
207 </simple>
208 </setBody>
209 <setHeader headerName="CamelHttpMethod">
210 <constant>POST</constant>
211 </setHeader>
212 <setHeader headerName="Content-Type">
sebdet5415b262019-04-26 13:04:08 +0200213 <constant>application/json</constant>
sebdet373b07b2019-04-26 12:04:26 +0200214 </setHeader>
215 <setHeader headerName="X-ONAP-RequestID">
216 <simple>${exchangeProperty[X-ONAP-RequestID]}
217 </simple>
218 </setHeader>
219 <setHeader headerName="X-ONAP-InvocationID">
220 <simple>${exchangeProperty[X-ONAP-InvocationID]}
221 </simple>
222 </setHeader>
223 <setHeader headerName="X-ONAP-PartnerName">
224 <simple>${exchangeProperty[X-ONAP-PartnerName]}
225 </simple>
226 </setHeader>
227 <log
228 loggingLevel="INFO"
sebdetaf8b7d72019-04-26 16:34:14 +0200229 message="Endpoint to create operational policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.operational/versions/1.0.0/policies"></log>
sebdet373b07b2019-04-26 12:04:26 +0200230 <toD
sebdetaf8b7d72019-04-26 16:34:14 +0200231 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.operational/versions/1.0.0/policies?bridgeEndpoint=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
sebdet373b07b2019-04-26 12:04:26 +0200232 <doFinally>
233 <to uri="direct:reset-raise-http-exception-flag" />
234 <to
235 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
236 <setProperty propertyName="logMessage">
237 <simple>${exchangeProperty[operationalPolicy].getName()} creation
238 status
239 </simple>
240 </setProperty>
241 <to uri="direct:dump-loop-log-http-response" />
242 </doFinally>
243 </doTry>
244 </route>
245
246 <route id="delete-operational-policy">
247 <from uri="direct:delete-operational-policy" />
248 <doTry>
249 <log
250 loggingLevel="INFO"
251 message="Deleting Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
252 <to
253 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Operational Policy')" />
254 <setBody>
255 <constant>null</constant>
256 </setBody>
257 <setHeader headerName="CamelHttpMethod">
258 <constant>DELETE</constant>
259 </setHeader>
260 <setHeader headerName="X-ONAP-RequestID">
261 <simple>${exchangeProperty[X-ONAP-RequestID]}
262 </simple>
263 </setHeader>
264 <setHeader headerName="X-ONAP-InvocationID">
265 <simple>${exchangeProperty[X-ONAP-InvocationID]}
266 </simple>
267 </setHeader>
268 <setHeader headerName="X-ONAP-PartnerName">
269 <simple>${exchangeProperty[X-ONAP-PartnerName]}
270 </simple>
271 </setHeader>
272 <log
273 loggingLevel="INFO"
sebdetaf8b7d72019-04-26 16:34:14 +0200274 message="Endpoint to delete operational policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}/versions/1.0.0"></log>
sebdet373b07b2019-04-26 12:04:26 +0200275 <toD
sebdetaf8b7d72019-04-26 16:34:14 +0200276 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}/versions/1.0.0?bridgeEndpoint=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
sebdet373b07b2019-04-26 12:04:26 +0200277 <doFinally>
278 <to uri="direct:reset-raise-http-exception-flag" />
279 <to
280 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
281 <setProperty propertyName="logMessage">
282 <simple>${exchangeProperty[operationalPolicy].getName()} removal
283 status
284 </simple>
285 </setProperty>
286 <to uri="direct:dump-loop-log-http-response" />
287 </doFinally>
288 </doTry>
289 </route>
290
291 <route id="create-guard-policy">
292 <from uri="direct:create-guard-policy" />
293 <doTry>
294 <log
295 loggingLevel="INFO"
296 message="Creating Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
297 <to
298 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Guard Policy')" />
299 <setBody>
300 <simple>${exchangeProperty[guardPolicy].getValue()}
301 </simple>
302 </setBody>
303 <setHeader headerName="CamelHttpMethod">
304 <constant>POST</constant>
305 </setHeader>
306 <setHeader headerName="Content-Type">
307 <constant>application/json</constant>
308 </setHeader>
309 <setHeader headerName="X-ONAP-RequestID">
310 <simple>${exchangeProperty[X-ONAP-RequestID]}
311 </simple>
312 </setHeader>
313 <setHeader headerName="X-ONAP-InvocationID">
314 <simple>${exchangeProperty[X-ONAP-InvocationID]}
315 </simple>
316 </setHeader>
317 <setHeader headerName="X-ONAP-PartnerName">
318 <simple>${exchangeProperty[X-ONAP-PartnerName]}
319 </simple>
320 </setHeader>
321 <log
322 loggingLevel="INFO"
sebdetaf8b7d72019-04-26 16:34:14 +0200323 message="Endpoint to create guard policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.guard/versions/1.0.0/policies"></log>
sebdet373b07b2019-04-26 12:04:26 +0200324 <toD
sebdetaf8b7d72019-04-26 16:34:14 +0200325 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.guard/versions/1.0.0/policies?bridgeEndpoint=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
sebdet373b07b2019-04-26 12:04:26 +0200326 <doFinally>
327 <to uri="direct:reset-raise-http-exception-flag" />
328 <to
329 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
330 <setProperty propertyName="logMessage">
331 <simple>${exchangeProperty[guardPolicy].getKey()} creation status
332 </simple>
333 </setProperty>
334 <to uri="direct:dump-loop-log-http-response" />
335 </doFinally>
336 </doTry>
337 </route>
338
339 <route id="delete-guard-policy">
340 <from uri="direct:delete-guard-policy" />
341 <doTry>
342 <log
343 loggingLevel="INFO"
344 message="Deleting Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
345 <to
346 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Guard Policy')" />
347 <setBody>
348 <constant>null</constant>
349 </setBody>
350 <setHeader headerName="CamelHttpMethod">
351 <constant>DELETE</constant>
352 </setHeader>
353 <setHeader headerName="X-ONAP-RequestID">
354 <simple>${exchangeProperty[X-ONAP-RequestID]}
355 </simple>
356 </setHeader>
357 <setHeader headerName="X-ONAP-InvocationID">
358 <simple>${exchangeProperty[X-ONAP-InvocationID]}
359 </simple>
360 </setHeader>
361 <setHeader headerName="X-ONAP-PartnerName">
362 <simple>${exchangeProperty[X-ONAP-PartnerName]}
363 </simple>
364 </setHeader>
365 <log
366 loggingLevel="INFO"
sebdetaf8b7d72019-04-26 16:34:14 +0200367 message="Endpoint to delete guard policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}/versions/1.0.0"></log>
sebdet373b07b2019-04-26 12:04:26 +0200368 <toD
sebdetaf8b7d72019-04-26 16:34:14 +0200369 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}/versions/1.0.0?bridgeEndpoint=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
sebdet373b07b2019-04-26 12:04:26 +0200370
371 <doFinally>
372 <to uri="direct:reset-raise-http-exception-flag" />
373 <to
374 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
375 <setProperty propertyName="logMessage">
376 <simple>${exchangeProperty[guardPolicy].getKey()} removal status
377 </simple>
378 </setProperty>
379 <to uri="direct:dump-loop-log-http-response" />
380 </doFinally>
381 </doTry>
382 </route>
383
384 <route id="add-all-to-active-pdp-group">
385 <from uri="direct:add-all-to-active-pdp-group" />
386 <doTry>
387 <log
388 loggingLevel="INFO"
389 message="Adding loop policies to PDP Group: ${exchangeProperty[loopObject].getName()}" />
390 <to
391 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Add policies to PDP group')" />
392 <setBody>
393 <simple>${exchangeProperty[loopObject].createPoliciesPayloadPdpGroup()}
394 </simple>
395 </setBody>
396 <setHeader headerName="CamelHttpMethod">
397 <constant>POST</constant>
398 </setHeader>
399 <setHeader headerName="Content-Type">
400 <constant>application/json</constant>
401 </setHeader>
402 <setHeader headerName="X-ONAP-RequestID">
403 <simple>${exchangeProperty[X-ONAP-RequestID]}
404 </simple>
405 </setHeader>
406 <setHeader headerName="X-ONAP-InvocationID">
407 <simple>${exchangeProperty[X-ONAP-InvocationID]}
408 </simple>
409 </setHeader>
410 <setHeader headerName="X-ONAP-PartnerName">
411 <simple>${exchangeProperty[X-ONAP-PartnerName]}
412 </simple>
413 </setHeader>
414 <log
415 loggingLevel="INFO"
sebdetaf8b7d72019-04-26 16:34:14 +0200416 message="Endpoint to add policies to PDP Group: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps"></log>
sebdet373b07b2019-04-26 12:04:26 +0200417 <toD
sebdetaf8b7d72019-04-26 16:34:14 +0200418 uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps?throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}" />
sebdet373b07b2019-04-26 12:04:26 +0200419
420 <doFinally>
421 <to uri="direct:reset-raise-http-exception-flag" />
422 <to
423 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
424 <setProperty propertyName="logMessage">
425 <simple>PDP Group push ALL status</simple>
426 </setProperty>
427 <to uri="direct:dump-loop-log-http-response" />
428 </doFinally>
429 </doTry>
430 </route>
431
432 <route id="remove-all-policy-from-active-pdp-group">
433 <from uri="direct:remove-all-policy-from-active-pdp-group" />
434 <doTry>
435 <log
436 loggingLevel="INFO"
437 message="Removing policies from active PDP group for loop: ${exchangeProperty[loopObject].getName()}" />
438 <to
439 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Removing policies PDP group')" />
440 <split>
441 <simple>${exchangeProperty[loopObject].listPolicyNamesPdpGroup()}
442 </simple>
443 <setProperty propertyName="policyName">
444 <simple>${body}</simple>
445 </setProperty>
446 <setBody>
447 <constant>null</constant>
448 </setBody>
449 <setHeader headerName="CamelHttpMethod">
450 <constant>DELETE</constant>
451 </setHeader>
452 <setHeader headerName="X-ONAP-RequestID">
453 <simple>${exchangeProperty[X-ONAP-RequestID]}
454 </simple>
455 </setHeader>
456 <setHeader headerName="X-ONAP-InvocationID">
457 <simple>${exchangeProperty[X-ONAP-InvocationID]}
458 </simple>
459 </setHeader>
460 <setHeader headerName="X-ONAP-PartnerName">
461 <simple>${exchangeProperty[X-ONAP-PartnerName]}
462 </simple>
463 </setHeader>
464 <log
465 loggingLevel="INFO"
sebdetaf8b7d72019-04-26 16:34:14 +0200466 message="Endpoint to delete policy from PDP Group: {{clamp.config.policy.pap.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0"></log>
sebdet373b07b2019-04-26 12:04:26 +0200467 <toD
sebdetaf8b7d72019-04-26 16:34:14 +0200468 uri="{{clamp.config.policy.pap.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0?bridgeEndpoint=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}" />
sebdet373b07b2019-04-26 12:04:26 +0200469 <setProperty propertyName="logMessage">
470 <simple>${exchangeProperty[policyName]} PDP Group removal status
471 </simple>
472 </setProperty>
473 <to uri="direct:dump-loop-log-http-response" />
474 </split>
475 <doCatch>
476 <exception>java.lang.Exception</exception>
477 <handled>
478 <constant>false</constant>
479 </handled>
480 <setProperty propertyName="logMessage">
481 <simple>${exchangeProperty[policyName]} PDP Group removal status
482 </simple>
483 </setProperty>
484 <to uri="direct:dump-loop-log-http-response" />
485 </doCatch>
486 <doFinally>
487 <to uri="direct:reset-raise-http-exception-flag" />
488 <to
489 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
490 </doFinally>
491 </doTry>
sebdet667cb722019-04-11 02:07:44 +0200492 </route>
xg353y39d82de2019-04-26 13:26:25 +0200493 <route id="deploy-closedloop">
494 <from uri="direct:deploy-closedloop" />
495 <doTry>
496 <log
497 loggingLevel="INFO"
498 message="Deploy the closed loop: ${exchangeProperty[loopObject].getName()}" />
499 <to
500 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Deploy closed loop')" />
501 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
502 </simple>
503 <setProperty propertyName="operationalPolicy">
504 <simple>${body}</simple>
505 </setProperty>
506 <setBody>
507 <method ref="org.onap.clamp.loop.LoopOperation"
508 method="getDeployPayload(${exchangeProperty[loopObject]})" />
509 </setBody>
510 <setProperty propertyName="deploymentId">
511 <method ref="org.onap.clamp.loop.LoopOperation"
512 method="getDeploymentId(${exchangeProperty[loopObject]})" />
513 </setProperty>
514 <setHeader headerName="CamelHttpMethod">
515 <constant>PUT</constant>
516 </setHeader>
517 <setHeader headerName="Content-Type">
518 <constant>application/json</constant>
519 </setHeader>
520 <setHeader headerName="X-ONAP-RequestID">
521 <simple>${exchangeProperty[X-ONAP-RequestID]}
522 </simple>
523 </setHeader>
524 <setHeader headerName="X-ONAP-InvocationID">
525 <simple>${exchangeProperty[X-ONAP-InvocationID]}
526 </simple>
527 </setHeader>
528 <setHeader headerName="X-ONAP-PartnerName">
529 <simple>${exchangeProperty[X-ONAP-PartnerName]}
530 </simple>
531 </setHeader>
532 <log
533 loggingLevel="INFO"
534 message="Endpoint to deploy closed loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}"></log>
535 <toD
536 uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}?bridgeEndpoint=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[RaiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}" />
537 <to
538 uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopInfo(*,${exchangeProperty[loopObject]},${exchangeProperty[deploymentId]})" />
539 <doFinally>
540 <to uri="direct:reset-raise-http-exception-flag" />
541 <to
542 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
543 <setProperty propertyName="logMessage">
544 <simple>Deploy closed loop status</simple>
545 </setProperty>
546 <to uri="direct:dump-loop-log-http-response" />
547 </doFinally>
548 </doTry>
549 </route>
sebdet338c2182019-04-25 12:33:31 +0200550
xg353y39d82de2019-04-26 13:26:25 +0200551 <route id="undeploy-closedloop">
552 <from uri="direct:undeploy-closedloop" />
553 <doTry>
554 <log
555 loggingLevel="INFO"
556 message="UNdeploy the closed loop: ${exchangeProperty[loopObject].getName()} : ${exchangeProperty[loopObject].getDcaeDeploymentId()}" />
557 <to
558 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Undeploy closed loop')" />
559
560 <setBody>
561 <simple>{\"serviceTypeId\": \"${exchangeProperty[loopObject].getDcaeBlueprintId()}\"}
562 </simple>
563 </setBody>
564 <setHeader headerName="CamelHttpMethod">
565 <constant>DELETE</constant>
566 </setHeader>
567 <setHeader headerName="Content-Type">
568 <constant>application/json</constant>
569 </setHeader>
570 <setHeader headerName="X-ONAP-RequestID">
571 <simple>${exchangeProperty[X-ONAP-RequestID]}
572 </simple>
573 </setHeader>
574 <setHeader headerName="X-ONAP-InvocationID">
575 <simple>${exchangeProperty[X-ONAP-InvocationID]}
576 </simple>
577 </setHeader>
578 <setHeader headerName="X-ONAP-PartnerName">
579 <simple>${exchangeProperty[X-ONAP-PartnerName]}
580 </simple>
581 </setHeader>
582 <log
583 loggingLevel="INFO"
584 message="Endpoint to undeploy closed loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}"></log>
585 <toD
586 uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}?bridgeEndpoint=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[RaiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}" />
587 <to
588 uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopInfo(*,${exchangeProperty[loopObject]},null)" />
589 <doFinally>
590 <to uri="direct:reset-raise-http-exception-flag" />
591 <to
592 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
593 <setProperty propertyName="logMessage">
594 <simple>Undeploy closed loop status</simple>
595 </setProperty>
596 <to uri="direct:dump-loop-log-http-response" />
597 </doFinally>
598 </doTry>
599 </route>
600 <route id="get-status-from-policy">
601 <from uri="direct:get-status-from-policy" />
602 <doTry>
603 <log
604 loggingLevel="INFO"
605 message="Query Closed Loop status from policy DPD: ${exchangeProperty[loopObject].getName()}" />
606 <to
607 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Query operational policies to PDP group')" />
xg353y7e8938e2019-05-03 13:23:40 +0200608 <setProperty propertyName="operationalPolicyName">
609 <method ref="org.onap.clamp.loop.LoopOperation"
610 method="getOperationalPolicyName(${exchangeProperty[loopObject]})" />
611 </setProperty>
xg353y39d82de2019-04-26 13:26:25 +0200612 <setHeader headerName="CamelHttpMethod">
613 <constant>GET</constant>
614 </setHeader>
615 <setHeader headerName="X-ONAP-RequestID">
616 <simple>${exchangeProperty[X-ONAP-RequestID]}
617 </simple>
618 </setHeader>
619 <setHeader headerName="X-ONAP-InvocationID">
620 <simple>${exchangeProperty[X-ONAP-InvocationID]}
621 </simple>
622 </setHeader>
623 <setHeader headerName="X-ONAP-PartnerName">
624 <simple>${exchangeProperty[X-ONAP-PartnerName]}
625 </simple>
626 </setHeader>
627 <log
628 loggingLevel="INFO"
xg353y7e8938e2019-05-03 13:23:40 +0200629 message="Endpoint to query from Policy DPD: {{clamp.config.policy.pap.url}}/policy/api/v1/policytypes/onap.policies.controlloop.operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicyName]}/versions/deployed"></log>
xg353y39d82de2019-04-26 13:26:25 +0200630 <toD
xg353y7e8938e2019-05-03 13:23:40 +0200631 uri="{{clamp.config.policy.pap.url}}/policy/api/v1/policytypes/onap.policies.controlloop.operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicyName]}/versions/deployed?bridgeEndpoint=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authMethod=Basic&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}" />
xg353y39d82de2019-04-26 13:26:25 +0200632 <doFinally>
633 <to uri="direct:reset-raise-http-exception-flag" />
634 <to
635 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
636 <setProperty propertyName="logMessage">
637 <simple>Query closed loop from Policy status</simple>
638 </setProperty>
639 <setProperty propertyName="policyStatus">
640 <method ref="org.onap.clamp.loop.LoopOperation"
641 method="analysePolicyResponse(${header.CamelHttpResponseCode})" />
642 </setProperty>
xg353y39d82de2019-04-26 13:26:25 +0200643 <to uri="direct:dump-loop-log-http-response" />
644 </doFinally>
645 </doTry>
646 </route>
647 <route id="get-status-from-dcae">
648 <from uri="direct:get-status-from-dcae" />
649 <log
650 loggingLevel="INFO"
651 message="Query Closed Loop status from DCAE ${exchangeProperty[loopObject].getName()}" />
652 <choice>
653 <when>
654 <simple>${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()} == null
655 </simple>
656 <setProperty propertyName="dcaeStatus">
657 <method ref="org.onap.clamp.loop.LoopOperation"
658 method="analyseDcaeResponse(*,null)" />
659 </setProperty>
660 <log
661 loggingLevel="INFO"
662 message="dcae status: ${exchangeProperty[dcaeStatus]}"></log>
663 </when>
664 <otherwise>
665 <doTry>
666 <log
667 loggingLevel="INFO"
668 message="Query Closed Loop status from Dcae" />
669 <setHeader headerName="CamelHttpMethod">
670 <constant>GET</constant>
671 </setHeader>
672 <setHeader headerName="X-ONAP-RequestID">
673 <simple>${exchangeProperty[X-ONAP-RequestID]}
674 </simple>
675 </setHeader>
676 <setHeader headerName="X-ONAP-InvocationID">
677 <simple>${exchangeProperty[X-ONAP-InvocationID]}
678 </simple>
679 </setHeader>
680 <setHeader headerName="X-ONAP-PartnerName">
681 <simple>${exchangeProperty[X-ONAP-PartnerName]}
682 </simple>
683 </setHeader>
684 <log
685 loggingLevel="INFO"
686 message="Endpoint to query Closed Loop status: ${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}"></log>
687 <toD
688 uri="${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}?bridgeEndpoint=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authMethod=Basic&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}" />
689 <doFinally>
690 <to uri="direct:reset-raise-http-exception-flag" />
691 <to
692 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
693 <setProperty propertyName="logMessage">
694 <simple>Query closed loop from DCAE status</simple>
695 </setProperty>
696 <setProperty propertyName="dcaeStatus">
697 <method ref="org.onap.clamp.loop.LoopOperation"
698 method="analyseDcaeResponse(*,${header.CamelHttpResponseCode})" />
699 </setProperty>
700 <log
701 loggingLevel="INFO"
702 message="dcae status: ${exchangeProperty[dcaeStatus]}"></log>
703 <to uri="direct:dump-loop-log-http-response" />
704 </doFinally>
705 </doTry>
706 </otherwise>
707 </choice>
708 </route>
sebdet667cb722019-04-11 02:07:44 +0200709 <route id="reset-raise-http-exception-flag">
710 <from uri="direct:reset-raise-http-exception-flag" />
sebdet338c2182019-04-25 12:33:31 +0200711 <setProperty propertyName="raiseHttpExceptionFlag">
sebdet1efe60f2019-04-11 17:58:36 +0200712 <simple resultType="java.lang.Boolean">true</simple>
sebdet338c2182019-04-25 12:33:31 +0200713 </setProperty>
sebdeteb71d702019-04-09 18:10:32 +0200714 </route>
sebdet373b07b2019-04-26 12:04:26 +0200715
716 <route id="dump-loop-log-http-response">
717 <from uri="direct:dump-loop-log-http-response" />
718 <to
719 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog(${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText},'INFO',${exchangeProperty[loopObject]})" />
720 </route>
Determe, Sebastien (sd378r)7c083742018-02-14 15:31:55 +0100721</routes>