blob: 1bad5fbbebedcdff293668782d49149d65d04db7 [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
Determe, Sebastien (sd378r)fdda7132019-05-30 00:07:49 +0200136 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&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
Determe, Sebastien (sd378r)fdda7132019-05-30 00:07:49 +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;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&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
Determe, Sebastien (sd378r)fdda7132019-05-30 00:07:49 +0200231 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&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"
Determe, Sebastien (sd378r)15c9ef02019-05-29 12:10:34 +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"></log>
sebdet373b07b2019-04-26 12:04:26 +0200275 <toD
Determe, Sebastien (sd378r)fdda7132019-05-30 00:07:49 +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?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&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
Determe, Sebastien (sd378r)fdda7132019-05-30 00:07:49 +0200325 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&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"
Determe, Sebastien (sd378r)15c9ef02019-05-29 12:10:34 +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"></log>
sebdet373b07b2019-04-26 12:04:26 +0200368 <toD
Determe, Sebastien (sd378r)fdda7132019-05-30 00:07:49 +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?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&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"
sebdet70aadbb2019-05-08 16:03:50 +0200416 message="Endpoint to add policies to PDP Group: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies"></log>
sebdet373b07b2019-04-26 12:04:26 +0200417 <toD
Determe, Sebastien (sd378r)fdda7132019-05-30 00:07:49 +0200418 uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies?bridgeEndpoint=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;useSystemProperties=true&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
Determe, Sebastien (sd378r)fdda7132019-05-30 00:07:49 +0200468 uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&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>
sebdetaa7fd8d2019-05-09 16:50:17 +0200492 <route id="deploy-loop">
493 <from uri="direct:deploy-loop" />
xg353y39d82de2019-04-26 13:26:25 +0200494 <doTry>
495 <log
496 loggingLevel="INFO"
sebdetca7f86c2019-05-13 17:18:10 +0200497 message="Deploying the loop: ${exchangeProperty[loopObject].getName()}" />
xg353y39d82de2019-04-26 13:26:25 +0200498 <to
sebdetca7f86c2019-05-13 17:18:10 +0200499 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Deploying the loop')" />
xg353y39d82de2019-04-26 13:26:25 +0200500 <setBody>
501 <method ref="org.onap.clamp.loop.LoopOperation"
502 method="getDeployPayload(${exchangeProperty[loopObject]})" />
503 </setBody>
504 <setProperty propertyName="deploymentId">
505 <method ref="org.onap.clamp.loop.LoopOperation"
506 method="getDeploymentId(${exchangeProperty[loopObject]})" />
507 </setProperty>
508 <setHeader headerName="CamelHttpMethod">
509 <constant>PUT</constant>
510 </setHeader>
511 <setHeader headerName="Content-Type">
512 <constant>application/json</constant>
513 </setHeader>
514 <setHeader headerName="X-ONAP-RequestID">
515 <simple>${exchangeProperty[X-ONAP-RequestID]}
516 </simple>
517 </setHeader>
518 <setHeader headerName="X-ONAP-InvocationID">
519 <simple>${exchangeProperty[X-ONAP-InvocationID]}
520 </simple>
521 </setHeader>
522 <setHeader headerName="X-ONAP-PartnerName">
523 <simple>${exchangeProperty[X-ONAP-PartnerName]}
524 </simple>
525 </setHeader>
526 <log
527 loggingLevel="INFO"
sebdetca7f86c2019-05-13 17:18:10 +0200528 message="Endpoint to deploy loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}"></log>
xg353y39d82de2019-04-26 13:26:25 +0200529 <toD
Determe, Sebastien (sd378r)fdda7132019-05-30 00:07:49 +0200530 uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}" />
xg353y39d82de2019-04-26 13:26:25 +0200531 <to
532 uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopInfo(*,${exchangeProperty[loopObject]},${exchangeProperty[deploymentId]})" />
533 <doFinally>
534 <to uri="direct:reset-raise-http-exception-flag" />
535 <to
536 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
537 <setProperty propertyName="logMessage">
sebdetca7f86c2019-05-13 17:18:10 +0200538 <simple>DEPLOY loop status (id:${exchangeProperty[deploymentId]})</simple>
xg353y39d82de2019-04-26 13:26:25 +0200539 </setProperty>
540 <to uri="direct:dump-loop-log-http-response" />
541 </doFinally>
542 </doTry>
543 </route>
sebdet338c2182019-04-25 12:33:31 +0200544
sebdetaa7fd8d2019-05-09 16:50:17 +0200545 <route id="undeploy-loop">
546 <from uri="direct:undeploy-loop" />
xg353y39d82de2019-04-26 13:26:25 +0200547 <doTry>
548 <log
549 loggingLevel="INFO"
sebdetca7f86c2019-05-13 17:18:10 +0200550 message="Undeploying the loop: ${exchangeProperty[loopObject].getName()} : ${exchangeProperty[loopObject].getDcaeDeploymentId()}" />
xg353y39d82de2019-04-26 13:26:25 +0200551 <to
sebdetca7f86c2019-05-13 17:18:10 +0200552 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Undeploying the loop')" />
xg353y39d82de2019-04-26 13:26:25 +0200553
554 <setBody>
555 <simple>{\"serviceTypeId\": \"${exchangeProperty[loopObject].getDcaeBlueprintId()}\"}
556 </simple>
557 </setBody>
558 <setHeader headerName="CamelHttpMethod">
559 <constant>DELETE</constant>
560 </setHeader>
561 <setHeader headerName="Content-Type">
562 <constant>application/json</constant>
563 </setHeader>
564 <setHeader headerName="X-ONAP-RequestID">
565 <simple>${exchangeProperty[X-ONAP-RequestID]}
566 </simple>
567 </setHeader>
568 <setHeader headerName="X-ONAP-InvocationID">
569 <simple>${exchangeProperty[X-ONAP-InvocationID]}
570 </simple>
571 </setHeader>
572 <setHeader headerName="X-ONAP-PartnerName">
573 <simple>${exchangeProperty[X-ONAP-PartnerName]}
574 </simple>
575 </setHeader>
576 <log
577 loggingLevel="INFO"
sebdetca7f86c2019-05-13 17:18:10 +0200578 message="Endpoint to undeploy loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}"></log>
xg353y39d82de2019-04-26 13:26:25 +0200579 <toD
Determe, Sebastien (sd378r)fdda7132019-05-30 00:07:49 +0200580 uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}" />
xg353y39d82de2019-04-26 13:26:25 +0200581 <to
582 uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopInfo(*,${exchangeProperty[loopObject]},null)" />
583 <doFinally>
584 <to uri="direct:reset-raise-http-exception-flag" />
585 <to
586 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
587 <setProperty propertyName="logMessage">
sebdetca7f86c2019-05-13 17:18:10 +0200588 <simple>UNDEPLOY loop status</simple>
xg353y39d82de2019-04-26 13:26:25 +0200589 </setProperty>
590 <to uri="direct:dump-loop-log-http-response" />
591 </doFinally>
592 </doTry>
593 </route>
594 <route id="get-status-from-policy">
595 <from uri="direct:get-status-from-policy" />
596 <doTry>
597 <log
598 loggingLevel="INFO"
sebdet7eb23452019-05-08 11:33:43 +0200599 message="Query Closed Loop status from policy PDP: ${exchangeProperty[loopObject].getName()}" />
xg353y39d82de2019-04-26 13:26:25 +0200600 <to
601 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Query operational policies to PDP group')" />
xg353y7e8938e2019-05-03 13:23:40 +0200602 <setProperty propertyName="operationalPolicyName">
603 <method ref="org.onap.clamp.loop.LoopOperation"
604 method="getOperationalPolicyName(${exchangeProperty[loopObject]})" />
605 </setProperty>
xg353y39d82de2019-04-26 13:26:25 +0200606 <setHeader headerName="CamelHttpMethod">
607 <constant>GET</constant>
608 </setHeader>
609 <setHeader headerName="X-ONAP-RequestID">
610 <simple>${exchangeProperty[X-ONAP-RequestID]}
611 </simple>
612 </setHeader>
613 <setHeader headerName="X-ONAP-InvocationID">
614 <simple>${exchangeProperty[X-ONAP-InvocationID]}
615 </simple>
616 </setHeader>
617 <setHeader headerName="X-ONAP-PartnerName">
618 <simple>${exchangeProperty[X-ONAP-PartnerName]}
619 </simple>
620 </setHeader>
621 <log
622 loggingLevel="INFO"
sebdet7eb23452019-05-08 11:33:43 +0200623 message="Endpoint to query from Policy PDP: {{clamp.config.policy.api.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 +0200624 <toD
Determe, Sebastien (sd378r)fdda7132019-05-30 00:07:49 +0200625 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicyName]}/versions/deployed?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authMethod=Basic&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}" />
xg353y39d82de2019-04-26 13:26:25 +0200626 <doFinally>
627 <to uri="direct:reset-raise-http-exception-flag" />
628 <to
629 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
630 <setProperty propertyName="logMessage">
sebdetca7f86c2019-05-13 17:18:10 +0200631 <simple>Policy deployment status</simple>
xg353y39d82de2019-04-26 13:26:25 +0200632 </setProperty>
633 <setProperty propertyName="policyStatus">
634 <method ref="org.onap.clamp.loop.LoopOperation"
635 method="analysePolicyResponse(${header.CamelHttpResponseCode})" />
636 </setProperty>
xg353y39d82de2019-04-26 13:26:25 +0200637 <to uri="direct:dump-loop-log-http-response" />
638 </doFinally>
639 </doTry>
640 </route>
641 <route id="get-status-from-dcae">
642 <from uri="direct:get-status-from-dcae" />
643 <log
644 loggingLevel="INFO"
645 message="Query Closed Loop status from DCAE ${exchangeProperty[loopObject].getName()}" />
646 <choice>
647 <when>
648 <simple>${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()} == null
649 </simple>
650 <setProperty propertyName="dcaeStatus">
651 <method ref="org.onap.clamp.loop.LoopOperation"
652 method="analyseDcaeResponse(*,null)" />
653 </setProperty>
654 <log
655 loggingLevel="INFO"
656 message="dcae status: ${exchangeProperty[dcaeStatus]}"></log>
657 </when>
658 <otherwise>
659 <doTry>
660 <log
661 loggingLevel="INFO"
662 message="Query Closed Loop status from Dcae" />
663 <setHeader headerName="CamelHttpMethod">
664 <constant>GET</constant>
665 </setHeader>
666 <setHeader headerName="X-ONAP-RequestID">
667 <simple>${exchangeProperty[X-ONAP-RequestID]}
668 </simple>
669 </setHeader>
670 <setHeader headerName="X-ONAP-InvocationID">
671 <simple>${exchangeProperty[X-ONAP-InvocationID]}
672 </simple>
673 </setHeader>
674 <setHeader headerName="X-ONAP-PartnerName">
675 <simple>${exchangeProperty[X-ONAP-PartnerName]}
676 </simple>
677 </setHeader>
678 <log
679 loggingLevel="INFO"
680 message="Endpoint to query Closed Loop status: ${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}"></log>
681 <toD
Determe, Sebastien (sd378r)fdda7132019-05-30 00:07:49 +0200682 uri="${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authMethod=Basic&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}" />
xg353y39d82de2019-04-26 13:26:25 +0200683 <doFinally>
684 <to uri="direct:reset-raise-http-exception-flag" />
685 <to
686 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
687 <setProperty propertyName="logMessage">
sebdetca7f86c2019-05-13 17:18:10 +0200688 <simple>DCAE deployment status</simple>
xg353y39d82de2019-04-26 13:26:25 +0200689 </setProperty>
690 <setProperty propertyName="dcaeStatus">
691 <method ref="org.onap.clamp.loop.LoopOperation"
692 method="analyseDcaeResponse(*,${header.CamelHttpResponseCode})" />
693 </setProperty>
694 <log
695 loggingLevel="INFO"
696 message="dcae status: ${exchangeProperty[dcaeStatus]}"></log>
697 <to uri="direct:dump-loop-log-http-response" />
698 </doFinally>
699 </doTry>
700 </otherwise>
701 </choice>
702 </route>
sebdet667cb722019-04-11 02:07:44 +0200703 <route id="reset-raise-http-exception-flag">
704 <from uri="direct:reset-raise-http-exception-flag" />
sebdet338c2182019-04-25 12:33:31 +0200705 <setProperty propertyName="raiseHttpExceptionFlag">
sebdet1efe60f2019-04-11 17:58:36 +0200706 <simple resultType="java.lang.Boolean">true</simple>
sebdet338c2182019-04-25 12:33:31 +0200707 </setProperty>
sebdeteb71d702019-04-09 18:10:32 +0200708 </route>
sebdet373b07b2019-04-26 12:04:26 +0200709
710 <route id="dump-loop-log-http-response">
711 <from uri="direct:dump-loop-log-http-response" />
sebdet584cc4a2019-05-03 14:32:53 +0200712 <log loggingLevel="INFO" message="${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}" />
sebdet373b07b2019-04-26 12:04:26 +0200713 <to
sebdet584cc4a2019-05-03 14:32:53 +0200714 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 +0200715 </route>
Determe, Sebastien (sd378r)7c083742018-02-14 15:31:55 +0100716</routes>