blob: 5d5861547cc6264351d0dd293770a821a5dc316c [file] [log] [blame]
sebdet09bc8452019-05-23 17:34:07 +02001
2<routes xmlns="http://camel.apache.org/schema/spring">
3 <route id="get-policy">
4 <from uri="direct:get-policy" />
5 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -07006 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +02007 message="Getting Policy: ${exchangeProperty[policyName]}" />
8 <to
9 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Get Policy')" />
10 <setHeader headerName="CamelHttpMethod">
11 <constant>GET</constant>
12 </setHeader>
13 <setHeader headerName="X-ONAP-RequestID">
14 <simple>${exchangeProperty[X-ONAP-RequestID]}
15 </simple>
16 </setHeader>
17 <setHeader headerName="X-ONAP-InvocationID">
18 <simple>${exchangeProperty[X-ONAP-InvocationID]}
19 </simple>
20 </setHeader>
21 <setHeader headerName="X-ONAP-PartnerName">
22 <simple>${exchangeProperty[X-ONAP-PartnerName]}
23 </simple>
24 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -070025 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +020026 message="Endpoint to get policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyType]}/versions/1.0.0/policies/${exchangeProperty[policyName]}/versions/1.0.0"></log>
27 <toD
sebdet493e9e72019-06-13 12:12:09 +020028 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyType]}/versions/1.0.0/policies/${exchangeProperty[policyName]}/versions/1.0.0?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
sebdet09bc8452019-05-23 17:34:07 +020029 <doFinally>
30 <to uri="direct:reset-raise-http-exception-flag" />
31 <to
32 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
33 <setProperty propertyName="logMessage">
34 <simple>${exchangeProperty[policyName]} GET
35 Policy status
36 </simple>
37 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -070038 <setProperty propertyName="logComponent">
39 <simple>POLICY</simple>
40 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +020041 <to uri="direct:dump-loop-log-http-response" />
42 </doFinally>
43 </doTry>
44 </route>
45
46 <route id="get-deployment-policy">
47 <from uri="direct:get-deployment-policy" />
48 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -070049 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +020050 message="Getting the policy deployment in PDP: ${exchangeProperty[policyName]}" />
51 <to
52 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Getting the policy deployment in PDP')" />
53 <setHeader headerName="CamelHttpMethod">
54 <constant>GET</constant>
55 </setHeader>
56 <setHeader headerName="X-ONAP-RequestID">
57 <simple>${exchangeProperty[X-ONAP-RequestID]}
58 </simple>
59 </setHeader>
60 <setHeader headerName="X-ONAP-InvocationID">
61 <simple>${exchangeProperty[X-ONAP-InvocationID]}
62 </simple>
63 </setHeader>
64 <setHeader headerName="X-ONAP-PartnerName">
65 <simple>${exchangeProperty[X-ONAP-PartnerName]}
66 </simple>
67 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -070068 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +020069 message="Endpoint to get policy deployment status: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyType]}/versions/1.0.0/policies/${exchangeProperty[policyName]}/versions/deployed"></log>
70 <toD
sebdet493e9e72019-06-13 12:12:09 +020071 uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyType]}/versions/1.0.0/policies/${exchangeProperty[policyName]}/versions/deployed?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
sebdet09bc8452019-05-23 17:34:07 +020072 <doFinally>
73 <to uri="direct:reset-raise-http-exception-flag" />
74 <to
75 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
76 <setProperty propertyName="logMessage">
77 <simple>${exchangeProperty[policyName]} GET Policy deployment
78 status
79 </simple>
80 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -070081 <setProperty propertyName="logComponent">
82 <simple>POLICY</simple>
83 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +020084 <to uri="direct:dump-loop-log-http-response" />
85 </doFinally>
86 </doTry>
87 </route>
88 <route id="create-micro-service-policy">
89 <from uri="direct:create-micro-service-policy" />
90 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -070091 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +020092 message="Creating Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
93 <to
94 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Micro Service Policy')" />
95 <setBody>
96 <simple>${exchangeProperty[microServicePolicy].createPolicyPayload()}
97 </simple>
98 </setBody>
99 <setHeader headerName="CamelHttpMethod">
100 <constant>POST</constant>
101 </setHeader>
102 <setHeader headerName="Content-Type">
103 <constant>application/json</constant>
104 </setHeader>
105 <setHeader headerName="X-ONAP-RequestID">
106 <simple>${exchangeProperty[X-ONAP-RequestID]}
107 </simple>
108 </setHeader>
109 <setHeader headerName="X-ONAP-InvocationID">
110 <simple>${exchangeProperty[X-ONAP-InvocationID]}
111 </simple>
112 </setHeader>
113 <setHeader headerName="X-ONAP-PartnerName">
114 <simple>${exchangeProperty[X-ONAP-PartnerName]}
115 </simple>
116 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700117 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200118 message="Endpoint to create microservice policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies"></log>
119 <toD
sebdet493e9e72019-06-13 12:12:09 +0200120 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;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
sebdet09bc8452019-05-23 17:34:07 +0200121 <doFinally>
122 <to uri="direct:reset-raise-http-exception-flag" />
123 <to
124 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
125 <setProperty propertyName="logMessage">
126 <simple>${exchangeProperty[microServicePolicy].getName()} creation
127 status
128 </simple>
129 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700130 <setProperty propertyName="logComponent">
131 <simple>POLICY</simple>
132 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200133 <to uri="direct:dump-loop-log-http-response" />
134 </doFinally>
135 </doTry>
136 </route>
137
138 <route id="delete-micro-service-policy">
139 <from uri="direct:delete-micro-service-policy" />
140 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -0700141 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200142 message="Deleting Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
143 <to
144 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Micro Service Policy')" />
145 <setBody>
146 <constant>null</constant>
147 </setBody>
148 <setHeader headerName="CamelHttpMethod">
149 <constant>DELETE</constant>
150 </setHeader>
151 <setHeader headerName="X-ONAP-RequestID">
152 <simple>${exchangeProperty[X-ONAP-RequestID]}
153 </simple>
154 </setHeader>
155 <setHeader headerName="X-ONAP-InvocationID">
156 <simple>${exchangeProperty[X-ONAP-InvocationID]}
157 </simple>
158 </setHeader>
159 <setHeader headerName="X-ONAP-PartnerName">
160 <simple>${exchangeProperty[X-ONAP-PartnerName]}
161 </simple>
162 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700163 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200164 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>
165 <toD
sebdet493e9e72019-06-13 12:12:09 +0200166 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;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
sebdet09bc8452019-05-23 17:34:07 +0200167
168 <doFinally>
169 <to uri="direct:reset-raise-http-exception-flag" />
170 <to
171 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
172 <setProperty propertyName="logMessage">
173 <simple>${exchangeProperty[microServicePolicy].getName()} removal
174 status
175 </simple>
176 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700177 <setProperty propertyName="logComponent">
178 <simple>POLICY</simple>
179 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200180 <to uri="direct:dump-loop-log-http-response" />
181 </doFinally>
182 </doTry>
183 </route>
184
185 <route id="create-operational-policy">
186 <from uri="direct:create-operational-policy" />
187 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -0700188 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200189 message="Creating Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
190 <to
191 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Operational Policy')" />
192 <setBody>
193 <simple>${exchangeProperty[operationalPolicy].createPolicyPayload()}
194 </simple>
195 </setBody>
196 <setHeader headerName="CamelHttpMethod">
197 <constant>POST</constant>
198 </setHeader>
199 <setHeader headerName="Content-Type">
200 <constant>application/json</constant>
201 </setHeader>
202 <setHeader headerName="X-ONAP-RequestID">
203 <simple>${exchangeProperty[X-ONAP-RequestID]}
204 </simple>
205 </setHeader>
206 <setHeader headerName="X-ONAP-InvocationID">
207 <simple>${exchangeProperty[X-ONAP-InvocationID]}
208 </simple>
209 </setHeader>
210 <setHeader headerName="X-ONAP-PartnerName">
211 <simple>${exchangeProperty[X-ONAP-PartnerName]}
212 </simple>
213 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700214 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200215 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>
216 <toD
sebdet493e9e72019-06-13 12:12:09 +0200217 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;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
sebdet09bc8452019-05-23 17:34:07 +0200218 <doFinally>
219 <to uri="direct:reset-raise-http-exception-flag" />
220 <to
221 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
222 <setProperty propertyName="logMessage">
223 <simple>${exchangeProperty[operationalPolicy].getName()} creation
224 status
225 </simple>
226 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700227 <setProperty propertyName="logComponent">
228 <simple>POLICY</simple>
229 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200230 <to uri="direct:dump-loop-log-http-response" />
231 </doFinally>
232 </doTry>
233 </route>
234
235 <route id="delete-operational-policy">
236 <from uri="direct:delete-operational-policy" />
237 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -0700238 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200239 message="Deleting Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
240 <to
241 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Operational Policy')" />
242 <setBody>
243 <constant>null</constant>
244 </setBody>
245 <setHeader headerName="CamelHttpMethod">
246 <constant>DELETE</constant>
247 </setHeader>
248 <setHeader headerName="X-ONAP-RequestID">
249 <simple>${exchangeProperty[X-ONAP-RequestID]}
250 </simple>
251 </setHeader>
252 <setHeader headerName="X-ONAP-InvocationID">
253 <simple>${exchangeProperty[X-ONAP-InvocationID]}
254 </simple>
255 </setHeader>
256 <setHeader headerName="X-ONAP-PartnerName">
257 <simple>${exchangeProperty[X-ONAP-PartnerName]}
258 </simple>
259 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700260 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200261 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>
262 <toD
sebdet493e9e72019-06-13 12:12:09 +0200263 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;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
sebdet09bc8452019-05-23 17:34:07 +0200264 <doFinally>
265 <to uri="direct:reset-raise-http-exception-flag" />
266 <to
267 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
268 <setProperty propertyName="logMessage">
269 <simple>${exchangeProperty[operationalPolicy].getName()} removal
270 status
271 </simple>
272 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700273 <setProperty propertyName="logComponent">
274 <simple>POLICY</simple>
275 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200276 <to uri="direct:dump-loop-log-http-response" />
277 </doFinally>
278 </doTry>
279 </route>
280
281 <route id="create-guard-policy">
282 <from uri="direct:create-guard-policy" />
283 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -0700284 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200285 message="Creating Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
286 <to
287 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Guard Policy')" />
288 <setBody>
289 <simple>${exchangeProperty[guardPolicy].getValue()}
290 </simple>
291 </setBody>
292 <setHeader headerName="CamelHttpMethod">
293 <constant>POST</constant>
294 </setHeader>
295 <setHeader headerName="Content-Type">
296 <constant>application/json</constant>
297 </setHeader>
298 <setHeader headerName="X-ONAP-RequestID">
299 <simple>${exchangeProperty[X-ONAP-RequestID]}
300 </simple>
301 </setHeader>
302 <setHeader headerName="X-ONAP-InvocationID">
303 <simple>${exchangeProperty[X-ONAP-InvocationID]}
304 </simple>
305 </setHeader>
306 <setHeader headerName="X-ONAP-PartnerName">
307 <simple>${exchangeProperty[X-ONAP-PartnerName]}
308 </simple>
309 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700310 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200311 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>
312 <toD
sebdet493e9e72019-06-13 12:12:09 +0200313 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;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
sebdet09bc8452019-05-23 17:34:07 +0200314 <doFinally>
315 <to uri="direct:reset-raise-http-exception-flag" />
316 <to
317 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
318 <setProperty propertyName="logMessage">
319 <simple>${exchangeProperty[guardPolicy].getKey()} creation status
320 </simple>
321 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700322 <setProperty propertyName="logComponent">
323 <simple>POLICY</simple>
324 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200325 <to uri="direct:dump-loop-log-http-response" />
326 </doFinally>
327 </doTry>
328 </route>
329
330 <route id="delete-guard-policy">
331 <from uri="direct:delete-guard-policy" />
332 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -0700333 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200334 message="Deleting Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
335 <to
336 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Guard Policy')" />
337 <setBody>
338 <constant>null</constant>
339 </setBody>
340 <setHeader headerName="CamelHttpMethod">
341 <constant>DELETE</constant>
342 </setHeader>
343 <setHeader headerName="X-ONAP-RequestID">
344 <simple>${exchangeProperty[X-ONAP-RequestID]}
345 </simple>
346 </setHeader>
347 <setHeader headerName="X-ONAP-InvocationID">
348 <simple>${exchangeProperty[X-ONAP-InvocationID]}
349 </simple>
350 </setHeader>
351 <setHeader headerName="X-ONAP-PartnerName">
352 <simple>${exchangeProperty[X-ONAP-PartnerName]}
353 </simple>
354 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700355 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200356 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>
357 <toD
sebdet493e9e72019-06-13 12:12:09 +0200358 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;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
sebdet09bc8452019-05-23 17:34:07 +0200359
360 <doFinally>
361 <to uri="direct:reset-raise-http-exception-flag" />
362 <to
363 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
364 <setProperty propertyName="logMessage">
365 <simple>${exchangeProperty[guardPolicy].getKey()} removal status
366 </simple>
367 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700368 <setProperty propertyName="logComponent">
369 <simple>POLICY</simple>
370 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200371 <to uri="direct:dump-loop-log-http-response" />
372 </doFinally>
373 </doTry>
374 </route>
375
376 <route id="add-all-to-active-pdp-group">
377 <from uri="direct:add-all-to-active-pdp-group" />
378 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -0700379 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200380 message="Adding loop policies to PDP Group: ${exchangeProperty[loopObject].getName()}" />
381 <to
382 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Add policies to PDP group')" />
383 <setBody>
384 <simple>${exchangeProperty[loopObject].getComponent("POLICY").createPoliciesPayloadPdpGroup(exchangeProperty[loopObject])}
385 </simple>
386 </setBody>
387 <setHeader headerName="CamelHttpMethod">
388 <constant>POST</constant>
389 </setHeader>
390 <setHeader headerName="Content-Type">
391 <constant>application/json</constant>
392 </setHeader>
393 <setHeader headerName="X-ONAP-RequestID">
394 <simple>${exchangeProperty[X-ONAP-RequestID]}
395 </simple>
396 </setHeader>
397 <setHeader headerName="X-ONAP-InvocationID">
398 <simple>${exchangeProperty[X-ONAP-InvocationID]}
399 </simple>
400 </setHeader>
401 <setHeader headerName="X-ONAP-PartnerName">
402 <simple>${exchangeProperty[X-ONAP-PartnerName]}
403 </simple>
404 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700405 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200406 message="Endpoint to add policies to PDP Group: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies"></log>
407 <toD
sebdet493e9e72019-06-13 12:12:09 +0200408 uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies?bridgeEndpoint=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;useSystemProperties=true&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
sebdet09bc8452019-05-23 17:34:07 +0200409
410 <doFinally>
411 <to uri="direct:reset-raise-http-exception-flag" />
412 <to
413 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
414 <setProperty propertyName="logMessage">
415 <simple>PDP Group push ALL status</simple>
416 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700417 <setProperty propertyName="logComponent">
418 <simple>POLICY</simple>
419 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200420 <to uri="direct:dump-loop-log-http-response" />
421 </doFinally>
422 </doTry>
423 </route>
424
425 <route id="remove-all-policy-from-active-pdp-group">
426 <from uri="direct:remove-all-policy-from-active-pdp-group" />
427 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -0700428 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200429 message="Removing policies from active PDP group for loop: ${exchangeProperty[loopObject].getName()}" />
430 <to
431 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Removing policies PDP group')" />
432 <split>
433 <simple>${exchangeProperty[loopObject].getComponent("POLICY").listPolicyNamesPdpGroup(exchangeProperty[loopObject])}
434 </simple>
435 <setProperty propertyName="policyName">
436 <simple>${body}</simple>
437 </setProperty>
438 <setBody>
439 <constant>null</constant>
440 </setBody>
441 <setHeader headerName="CamelHttpMethod">
442 <constant>DELETE</constant>
443 </setHeader>
444 <setHeader headerName="X-ONAP-RequestID">
445 <simple>${exchangeProperty[X-ONAP-RequestID]}
446 </simple>
447 </setHeader>
448 <setHeader headerName="X-ONAP-InvocationID">
449 <simple>${exchangeProperty[X-ONAP-InvocationID]}
450 </simple>
451 </setHeader>
452 <setHeader headerName="X-ONAP-PartnerName">
453 <simple>${exchangeProperty[X-ONAP-PartnerName]}
454 </simple>
455 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700456 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200457 message="Endpoint to delete policy from PDP Group: {{clamp.config.policy.pap.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0"></log>
458 <toD
sebdet493e9e72019-06-13 12:12:09 +0200459 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;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
sebdet09bc8452019-05-23 17:34:07 +0200460 <setProperty propertyName="logMessage">
461 <simple>${exchangeProperty[policyName]} PDP Group removal status
462 </simple>
463 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700464 <setProperty propertyName="logComponent">
465 <simple>POLICY</simple>
466 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200467 <to uri="direct:dump-loop-log-http-response" />
468 </split>
469 <doCatch>
470 <exception>java.lang.Exception</exception>
471 <handled>
472 <constant>false</constant>
473 </handled>
474 <setProperty propertyName="logMessage">
475 <simple>PDP Group removal, Error reported: ${exception}</simple>
476 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700477 <setProperty propertyName="logComponent">
478 <simple>POLICY</simple>
479 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200480 <to uri="direct:dump-loop-log-http-response" />
481 </doCatch>
482 <doFinally>
483 <to uri="direct:reset-raise-http-exception-flag" />
484 <to
485 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
486 </doFinally>
487 </doTry>
488 </route>
489</routes>