blob: 5fc29fad8039e1a2906a6a655a5b7a7023b0f7fa [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"
sebdetedae4aa2019-05-03 17:16:17 +0200229 message="Endpoint to create operational policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies"></log>
sebdet373b07b2019-04-26 12:04:26 +0200230 <toD
sebdetedae4aa2019-05-03 17:16:17 +0200231 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.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"
sebdetedae4aa2019-05-03 17:16:17 +0200274 message="Endpoint to delete operational policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}/versions/1.0.0"></log>
sebdet373b07b2019-04-26 12:04:26 +0200275 <toD
sebdetedae4aa2019-05-03 17:16:17 +0200276 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.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"
sebdetedae4aa2019-05-03 17:16:17 +0200323 message="Endpoint to create guard policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies"></log>
sebdet373b07b2019-04-26 12:04:26 +0200324 <toD
sebdetedae4aa2019-05-03 17:16:17 +0200325 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.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"
sebdetedae4aa2019-05-03 17:16:17 +0200367 message="Endpoint to delete guard policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}/versions/1.0.0"></log>
sebdet373b07b2019-04-26 12:04:26 +0200368 <toD
sebdetedae4aa2019-05-03 17:16:17 +0200369 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.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">
sebdet584cc4a2019-05-03 14:32:53 +0200481 <simple>PDP Group removal, Error reported: ${exception}</simple>
sebdet373b07b2019-04-26 12:04:26 +0200482 </setProperty>
483 <to uri="direct:dump-loop-log-http-response" />
484 </doCatch>
485 <doFinally>
486 <to uri="direct:reset-raise-http-exception-flag" />
487 <to
488 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
489 </doFinally>
490 </doTry>
sebdet667cb722019-04-11 02:07:44 +0200491 </route>
xg353y39d82de2019-04-26 13:26:25 +0200492 <route id="deploy-closedloop">
493 <from uri="direct:deploy-closedloop" />
494 <doTry>
495 <log
496 loggingLevel="INFO"
497 message="Deploy the closed loop: ${exchangeProperty[loopObject].getName()}" />
498 <to
499 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Deploy closed loop')" />
500 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
501 </simple>
502 <setProperty propertyName="operationalPolicy">
503 <simple>${body}</simple>
504 </setProperty>
505 <setBody>
506 <method ref="org.onap.clamp.loop.LoopOperation"
507 method="getDeployPayload(${exchangeProperty[loopObject]})" />
508 </setBody>
509 <setProperty propertyName="deploymentId">
510 <method ref="org.onap.clamp.loop.LoopOperation"
511 method="getDeploymentId(${exchangeProperty[loopObject]})" />
512 </setProperty>
513 <setHeader headerName="CamelHttpMethod">
514 <constant>PUT</constant>
515 </setHeader>
516 <setHeader headerName="Content-Type">
517 <constant>application/json</constant>
518 </setHeader>
519 <setHeader headerName="X-ONAP-RequestID">
520 <simple>${exchangeProperty[X-ONAP-RequestID]}
521 </simple>
522 </setHeader>
523 <setHeader headerName="X-ONAP-InvocationID">
524 <simple>${exchangeProperty[X-ONAP-InvocationID]}
525 </simple>
526 </setHeader>
527 <setHeader headerName="X-ONAP-PartnerName">
528 <simple>${exchangeProperty[X-ONAP-PartnerName]}
529 </simple>
530 </setHeader>
531 <log
532 loggingLevel="INFO"
533 message="Endpoint to deploy closed loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}"></log>
534 <toD
535 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}}" />
536 <to
537 uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopInfo(*,${exchangeProperty[loopObject]},${exchangeProperty[deploymentId]})" />
538 <doFinally>
539 <to uri="direct:reset-raise-http-exception-flag" />
540 <to
541 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
542 <setProperty propertyName="logMessage">
543 <simple>Deploy closed loop status</simple>
544 </setProperty>
545 <to uri="direct:dump-loop-log-http-response" />
546 </doFinally>
547 </doTry>
548 </route>
sebdet338c2182019-04-25 12:33:31 +0200549
xg353y39d82de2019-04-26 13:26:25 +0200550 <route id="undeploy-closedloop">
551 <from uri="direct:undeploy-closedloop" />
552 <doTry>
553 <log
554 loggingLevel="INFO"
555 message="UNdeploy the closed loop: ${exchangeProperty[loopObject].getName()} : ${exchangeProperty[loopObject].getDcaeDeploymentId()}" />
556 <to
557 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Undeploy closed loop')" />
558
559 <setBody>
560 <simple>{\"serviceTypeId\": \"${exchangeProperty[loopObject].getDcaeBlueprintId()}\"}
561 </simple>
562 </setBody>
563 <setHeader headerName="CamelHttpMethod">
564 <constant>DELETE</constant>
565 </setHeader>
566 <setHeader headerName="Content-Type">
567 <constant>application/json</constant>
568 </setHeader>
569 <setHeader headerName="X-ONAP-RequestID">
570 <simple>${exchangeProperty[X-ONAP-RequestID]}
571 </simple>
572 </setHeader>
573 <setHeader headerName="X-ONAP-InvocationID">
574 <simple>${exchangeProperty[X-ONAP-InvocationID]}
575 </simple>
576 </setHeader>
577 <setHeader headerName="X-ONAP-PartnerName">
578 <simple>${exchangeProperty[X-ONAP-PartnerName]}
579 </simple>
580 </setHeader>
581 <log
582 loggingLevel="INFO"
583 message="Endpoint to undeploy closed loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}"></log>
584 <toD
585 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}}" />
586 <to
587 uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopInfo(*,${exchangeProperty[loopObject]},null)" />
588 <doFinally>
589 <to uri="direct:reset-raise-http-exception-flag" />
590 <to
591 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
592 <setProperty propertyName="logMessage">
593 <simple>Undeploy closed loop status</simple>
594 </setProperty>
595 <to uri="direct:dump-loop-log-http-response" />
596 </doFinally>
597 </doTry>
598 </route>
599 <route id="get-status-from-policy">
600 <from uri="direct:get-status-from-policy" />
601 <doTry>
602 <log
603 loggingLevel="INFO"
604 message="Query Closed Loop status from policy DPD: ${exchangeProperty[loopObject].getName()}" />
605 <to
606 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Query operational policies to PDP group')" />
xg353y7e8938e2019-05-03 13:23:40 +0200607 <setProperty propertyName="operationalPolicyName">
608 <method ref="org.onap.clamp.loop.LoopOperation"
609 method="getOperationalPolicyName(${exchangeProperty[loopObject]})" />
610 </setProperty>
xg353y39d82de2019-04-26 13:26:25 +0200611 <setHeader headerName="CamelHttpMethod">
612 <constant>GET</constant>
613 </setHeader>
614 <setHeader headerName="X-ONAP-RequestID">
615 <simple>${exchangeProperty[X-ONAP-RequestID]}
616 </simple>
617 </setHeader>
618 <setHeader headerName="X-ONAP-InvocationID">
619 <simple>${exchangeProperty[X-ONAP-InvocationID]}
620 </simple>
621 </setHeader>
622 <setHeader headerName="X-ONAP-PartnerName">
623 <simple>${exchangeProperty[X-ONAP-PartnerName]}
624 </simple>
625 </setHeader>
626 <log
627 loggingLevel="INFO"
xg353y7e8938e2019-05-03 13:23:40 +0200628 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 +0200629 <toD
xg353y7e8938e2019-05-03 13:23:40 +0200630 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 +0200631 <doFinally>
632 <to uri="direct:reset-raise-http-exception-flag" />
633 <to
634 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
635 <setProperty propertyName="logMessage">
636 <simple>Query closed loop from Policy status</simple>
637 </setProperty>
638 <setProperty propertyName="policyStatus">
639 <method ref="org.onap.clamp.loop.LoopOperation"
640 method="analysePolicyResponse(${header.CamelHttpResponseCode})" />
641 </setProperty>
xg353y39d82de2019-04-26 13:26:25 +0200642 <to uri="direct:dump-loop-log-http-response" />
643 </doFinally>
644 </doTry>
645 </route>
646 <route id="get-status-from-dcae">
647 <from uri="direct:get-status-from-dcae" />
648 <log
649 loggingLevel="INFO"
650 message="Query Closed Loop status from DCAE ${exchangeProperty[loopObject].getName()}" />
651 <choice>
652 <when>
653 <simple>${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()} == null
654 </simple>
655 <setProperty propertyName="dcaeStatus">
656 <method ref="org.onap.clamp.loop.LoopOperation"
657 method="analyseDcaeResponse(*,null)" />
658 </setProperty>
659 <log
660 loggingLevel="INFO"
661 message="dcae status: ${exchangeProperty[dcaeStatus]}"></log>
662 </when>
663 <otherwise>
664 <doTry>
665 <log
666 loggingLevel="INFO"
667 message="Query Closed Loop status from Dcae" />
668 <setHeader headerName="CamelHttpMethod">
669 <constant>GET</constant>
670 </setHeader>
671 <setHeader headerName="X-ONAP-RequestID">
672 <simple>${exchangeProperty[X-ONAP-RequestID]}
673 </simple>
674 </setHeader>
675 <setHeader headerName="X-ONAP-InvocationID">
676 <simple>${exchangeProperty[X-ONAP-InvocationID]}
677 </simple>
678 </setHeader>
679 <setHeader headerName="X-ONAP-PartnerName">
680 <simple>${exchangeProperty[X-ONAP-PartnerName]}
681 </simple>
682 </setHeader>
683 <log
684 loggingLevel="INFO"
685 message="Endpoint to query Closed Loop status: ${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}"></log>
686 <toD
687 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}}" />
688 <doFinally>
689 <to uri="direct:reset-raise-http-exception-flag" />
690 <to
691 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
692 <setProperty propertyName="logMessage">
693 <simple>Query closed loop from DCAE status</simple>
694 </setProperty>
695 <setProperty propertyName="dcaeStatus">
696 <method ref="org.onap.clamp.loop.LoopOperation"
697 method="analyseDcaeResponse(*,${header.CamelHttpResponseCode})" />
698 </setProperty>
699 <log
700 loggingLevel="INFO"
701 message="dcae status: ${exchangeProperty[dcaeStatus]}"></log>
702 <to uri="direct:dump-loop-log-http-response" />
703 </doFinally>
704 </doTry>
705 </otherwise>
706 </choice>
707 </route>
sebdet667cb722019-04-11 02:07:44 +0200708 <route id="reset-raise-http-exception-flag">
709 <from uri="direct:reset-raise-http-exception-flag" />
sebdet338c2182019-04-25 12:33:31 +0200710 <setProperty propertyName="raiseHttpExceptionFlag">
sebdet1efe60f2019-04-11 17:58:36 +0200711 <simple resultType="java.lang.Boolean">true</simple>
sebdet338c2182019-04-25 12:33:31 +0200712 </setProperty>
sebdeteb71d702019-04-09 18:10:32 +0200713 </route>
sebdet373b07b2019-04-26 12:04:26 +0200714
715 <route id="dump-loop-log-http-response">
716 <from uri="direct:dump-loop-log-http-response" />
sebdet584cc4a2019-05-03 14:32:53 +0200717 <log loggingLevel="INFO" message="${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}" />
sebdet373b07b2019-04-26 12:04:26 +0200718 <to
sebdet584cc4a2019-05-03 14:32:53 +0200719 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO',${exchangeProperty[loopObject]})" />
sebdet373b07b2019-04-26 12:04:26 +0200720 </route>
Determe, Sebastien (sd378r)7c083742018-02-14 15:31:55 +0100721</routes>