blob: b6f30c37c5573d55dd74248084c3397597bf1627 [file] [log] [blame]
sebdet09bc8452019-05-23 17:34:07 +02001
2<routes xmlns="http://camel.apache.org/schema/spring">
sebdet3142c702019-08-23 07:45:27 -07003 <route id="verify-one-policy">
4 <from uri="direct:verify-one-policy" />
5 <setProperty propertyName="raiseHttpExceptionFlag">
6 <simple resultType="java.lang.Boolean">false</simple>
7 </setProperty>
8 <to uri="direct:get-policy" />
9 <when>
10 <simple> ${header.CamelHttpResponseCode} != 200 </simple>
11 <setProperty propertyName="policyFound">
12 <simple resultType="java.lang.Boolean">false</simple>
13 </setProperty>
14 <log loggingLevel="WARN"
15 message="At least one policy has not been found on policy engine: ${exchangeProperty[policyName]}" />
16 </when>
17 <setProperty propertyName="raiseHttpExceptionFlag">
18 <simple resultType="java.lang.Boolean">false</simple>
19 </setProperty>
20 <to uri="direct:get-deployment-policy" />
21 <when>
22 <simple> ${header.CamelHttpResponseCode} != 200 </simple>
23 <setProperty propertyName="policyDeployed">
24 <simple resultType="java.lang.Boolean">false</simple>
25 </setProperty>
26 <log loggingLevel="WARN"
27 message="At least one policy has not been deployed on policy engine: ${exchangeProperty[policyName]}" />
28 </when>
29 <setProperty propertyName="newPolicyState">
30 <simple>${exchangeProperty[policyComponent].computeState(*)}</simple>
31 </setProperty>
32 </route>
33
sebdet09bc8452019-05-23 17:34:07 +020034 <route id="get-policy">
35 <from uri="direct:get-policy" />
36 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -070037 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +020038 message="Getting Policy: ${exchangeProperty[policyName]}" />
39 <to
40 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Get Policy')" />
41 <setHeader headerName="CamelHttpMethod">
42 <constant>GET</constant>
43 </setHeader>
44 <setHeader headerName="X-ONAP-RequestID">
45 <simple>${exchangeProperty[X-ONAP-RequestID]}
46 </simple>
47 </setHeader>
48 <setHeader headerName="X-ONAP-InvocationID">
49 <simple>${exchangeProperty[X-ONAP-InvocationID]}
50 </simple>
51 </setHeader>
52 <setHeader headerName="X-ONAP-PartnerName">
53 <simple>${exchangeProperty[X-ONAP-PartnerName]}
54 </simple>
55 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -070056 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +020057 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>
58 <toD
sebdet493e9e72019-06-13 12:12:09 +020059 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 +020060 <doFinally>
61 <to uri="direct:reset-raise-http-exception-flag" />
62 <to
63 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
64 <setProperty propertyName="logMessage">
65 <simple>${exchangeProperty[policyName]} GET
66 Policy status
67 </simple>
68 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -070069 <setProperty propertyName="logComponent">
70 <simple>POLICY</simple>
71 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +020072 <to uri="direct:dump-loop-log-http-response" />
73 </doFinally>
74 </doTry>
75 </route>
76
77 <route id="get-deployment-policy">
78 <from uri="direct:get-deployment-policy" />
79 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -070080 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +020081 message="Getting the policy deployment in PDP: ${exchangeProperty[policyName]}" />
82 <to
83 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Getting the policy deployment in PDP')" />
84 <setHeader headerName="CamelHttpMethod">
85 <constant>GET</constant>
86 </setHeader>
87 <setHeader headerName="X-ONAP-RequestID">
88 <simple>${exchangeProperty[X-ONAP-RequestID]}
89 </simple>
90 </setHeader>
91 <setHeader headerName="X-ONAP-InvocationID">
92 <simple>${exchangeProperty[X-ONAP-InvocationID]}
93 </simple>
94 </setHeader>
95 <setHeader headerName="X-ONAP-PartnerName">
96 <simple>${exchangeProperty[X-ONAP-PartnerName]}
97 </simple>
98 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -070099 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200100 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>
101 <toD
sebdet493e9e72019-06-13 12:12:09 +0200102 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 +0200103 <doFinally>
104 <to uri="direct:reset-raise-http-exception-flag" />
105 <to
106 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
107 <setProperty propertyName="logMessage">
108 <simple>${exchangeProperty[policyName]} GET Policy deployment
109 status
110 </simple>
111 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700112 <setProperty propertyName="logComponent">
113 <simple>POLICY</simple>
114 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200115 <to uri="direct:dump-loop-log-http-response" />
116 </doFinally>
117 </doTry>
118 </route>
119 <route id="create-micro-service-policy">
120 <from uri="direct:create-micro-service-policy" />
121 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -0700122 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200123 message="Creating Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
124 <to
125 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Micro Service Policy')" />
126 <setBody>
127 <simple>${exchangeProperty[microServicePolicy].createPolicyPayload()}
128 </simple>
129 </setBody>
130 <setHeader headerName="CamelHttpMethod">
131 <constant>POST</constant>
132 </setHeader>
133 <setHeader headerName="Content-Type">
134 <constant>application/json</constant>
135 </setHeader>
136 <setHeader headerName="X-ONAP-RequestID">
137 <simple>${exchangeProperty[X-ONAP-RequestID]}
138 </simple>
139 </setHeader>
140 <setHeader headerName="X-ONAP-InvocationID">
141 <simple>${exchangeProperty[X-ONAP-InvocationID]}
142 </simple>
143 </setHeader>
144 <setHeader headerName="X-ONAP-PartnerName">
145 <simple>${exchangeProperty[X-ONAP-PartnerName]}
146 </simple>
147 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700148 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200149 message="Endpoint to create microservice policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies"></log>
150 <toD
sebdet493e9e72019-06-13 12:12:09 +0200151 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 +0200152 <doFinally>
153 <to uri="direct:reset-raise-http-exception-flag" />
154 <to
155 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
156 <setProperty propertyName="logMessage">
157 <simple>${exchangeProperty[microServicePolicy].getName()} creation
158 status
159 </simple>
160 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700161 <setProperty propertyName="logComponent">
162 <simple>POLICY</simple>
163 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200164 <to uri="direct:dump-loop-log-http-response" />
165 </doFinally>
166 </doTry>
167 </route>
168
169 <route id="delete-micro-service-policy">
170 <from uri="direct:delete-micro-service-policy" />
171 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -0700172 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200173 message="Deleting Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
174 <to
175 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Micro Service Policy')" />
176 <setBody>
177 <constant>null</constant>
178 </setBody>
179 <setHeader headerName="CamelHttpMethod">
180 <constant>DELETE</constant>
181 </setHeader>
182 <setHeader headerName="X-ONAP-RequestID">
183 <simple>${exchangeProperty[X-ONAP-RequestID]}
184 </simple>
185 </setHeader>
186 <setHeader headerName="X-ONAP-InvocationID">
187 <simple>${exchangeProperty[X-ONAP-InvocationID]}
188 </simple>
189 </setHeader>
190 <setHeader headerName="X-ONAP-PartnerName">
191 <simple>${exchangeProperty[X-ONAP-PartnerName]}
192 </simple>
193 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700194 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200195 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>
196 <toD
sebdet493e9e72019-06-13 12:12:09 +0200197 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 +0200198
199 <doFinally>
200 <to uri="direct:reset-raise-http-exception-flag" />
201 <to
202 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
203 <setProperty propertyName="logMessage">
204 <simple>${exchangeProperty[microServicePolicy].getName()} removal
205 status
206 </simple>
207 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700208 <setProperty propertyName="logComponent">
209 <simple>POLICY</simple>
210 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200211 <to uri="direct:dump-loop-log-http-response" />
212 </doFinally>
213 </doTry>
214 </route>
215
216 <route id="create-operational-policy">
217 <from uri="direct:create-operational-policy" />
218 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -0700219 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200220 message="Creating Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
221 <to
222 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Operational Policy')" />
223 <setBody>
224 <simple>${exchangeProperty[operationalPolicy].createPolicyPayload()}
225 </simple>
226 </setBody>
227 <setHeader headerName="CamelHttpMethod">
228 <constant>POST</constant>
229 </setHeader>
230 <setHeader headerName="Content-Type">
231 <constant>application/json</constant>
232 </setHeader>
233 <setHeader headerName="X-ONAP-RequestID">
234 <simple>${exchangeProperty[X-ONAP-RequestID]}
235 </simple>
236 </setHeader>
237 <setHeader headerName="X-ONAP-InvocationID">
238 <simple>${exchangeProperty[X-ONAP-InvocationID]}
239 </simple>
240 </setHeader>
241 <setHeader headerName="X-ONAP-PartnerName">
242 <simple>${exchangeProperty[X-ONAP-PartnerName]}
243 </simple>
244 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700245 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200246 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>
247 <toD
sebdet493e9e72019-06-13 12:12:09 +0200248 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 +0200249 <doFinally>
250 <to uri="direct:reset-raise-http-exception-flag" />
251 <to
252 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
253 <setProperty propertyName="logMessage">
254 <simple>${exchangeProperty[operationalPolicy].getName()} creation
255 status
256 </simple>
257 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700258 <setProperty propertyName="logComponent">
259 <simple>POLICY</simple>
260 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200261 <to uri="direct:dump-loop-log-http-response" />
262 </doFinally>
263 </doTry>
264 </route>
265
266 <route id="delete-operational-policy">
267 <from uri="direct:delete-operational-policy" />
268 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -0700269 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200270 message="Deleting Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
271 <to
272 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Operational Policy')" />
273 <setBody>
274 <constant>null</constant>
275 </setBody>
276 <setHeader headerName="CamelHttpMethod">
277 <constant>DELETE</constant>
278 </setHeader>
279 <setHeader headerName="X-ONAP-RequestID">
280 <simple>${exchangeProperty[X-ONAP-RequestID]}
281 </simple>
282 </setHeader>
283 <setHeader headerName="X-ONAP-InvocationID">
284 <simple>${exchangeProperty[X-ONAP-InvocationID]}
285 </simple>
286 </setHeader>
287 <setHeader headerName="X-ONAP-PartnerName">
288 <simple>${exchangeProperty[X-ONAP-PartnerName]}
289 </simple>
290 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700291 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200292 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>
293 <toD
sebdet493e9e72019-06-13 12:12:09 +0200294 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 +0200295 <doFinally>
296 <to uri="direct:reset-raise-http-exception-flag" />
297 <to
298 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
299 <setProperty propertyName="logMessage">
300 <simple>${exchangeProperty[operationalPolicy].getName()} removal
301 status
302 </simple>
303 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700304 <setProperty propertyName="logComponent">
305 <simple>POLICY</simple>
306 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200307 <to uri="direct:dump-loop-log-http-response" />
308 </doFinally>
309 </doTry>
310 </route>
311
312 <route id="create-guard-policy">
313 <from uri="direct:create-guard-policy" />
314 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -0700315 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200316 message="Creating Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
317 <to
318 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Guard Policy')" />
319 <setBody>
320 <simple>${exchangeProperty[guardPolicy].getValue()}
321 </simple>
322 </setBody>
323 <setHeader headerName="CamelHttpMethod">
324 <constant>POST</constant>
325 </setHeader>
326 <setHeader headerName="Content-Type">
327 <constant>application/json</constant>
328 </setHeader>
329 <setHeader headerName="X-ONAP-RequestID">
330 <simple>${exchangeProperty[X-ONAP-RequestID]}
331 </simple>
332 </setHeader>
333 <setHeader headerName="X-ONAP-InvocationID">
334 <simple>${exchangeProperty[X-ONAP-InvocationID]}
335 </simple>
336 </setHeader>
337 <setHeader headerName="X-ONAP-PartnerName">
338 <simple>${exchangeProperty[X-ONAP-PartnerName]}
339 </simple>
340 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700341 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200342 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>
343 <toD
sebdet493e9e72019-06-13 12:12:09 +0200344 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 +0200345 <doFinally>
346 <to uri="direct:reset-raise-http-exception-flag" />
347 <to
348 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
349 <setProperty propertyName="logMessage">
350 <simple>${exchangeProperty[guardPolicy].getKey()} creation status
351 </simple>
352 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700353 <setProperty propertyName="logComponent">
354 <simple>POLICY</simple>
355 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200356 <to uri="direct:dump-loop-log-http-response" />
357 </doFinally>
358 </doTry>
359 </route>
360
361 <route id="delete-guard-policy">
362 <from uri="direct:delete-guard-policy" />
363 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -0700364 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200365 message="Deleting Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
366 <to
367 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Guard Policy')" />
368 <setBody>
369 <constant>null</constant>
370 </setBody>
371 <setHeader headerName="CamelHttpMethod">
372 <constant>DELETE</constant>
373 </setHeader>
374 <setHeader headerName="X-ONAP-RequestID">
375 <simple>${exchangeProperty[X-ONAP-RequestID]}
376 </simple>
377 </setHeader>
378 <setHeader headerName="X-ONAP-InvocationID">
379 <simple>${exchangeProperty[X-ONAP-InvocationID]}
380 </simple>
381 </setHeader>
382 <setHeader headerName="X-ONAP-PartnerName">
383 <simple>${exchangeProperty[X-ONAP-PartnerName]}
384 </simple>
385 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700386 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200387 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>
388 <toD
sebdet493e9e72019-06-13 12:12:09 +0200389 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 +0200390
391 <doFinally>
392 <to uri="direct:reset-raise-http-exception-flag" />
393 <to
394 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
395 <setProperty propertyName="logMessage">
396 <simple>${exchangeProperty[guardPolicy].getKey()} removal status
397 </simple>
398 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700399 <setProperty propertyName="logComponent">
400 <simple>POLICY</simple>
401 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200402 <to uri="direct:dump-loop-log-http-response" />
403 </doFinally>
404 </doTry>
405 </route>
406
407 <route id="add-all-to-active-pdp-group">
408 <from uri="direct:add-all-to-active-pdp-group" />
409 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -0700410 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200411 message="Adding loop policies to PDP Group: ${exchangeProperty[loopObject].getName()}" />
412 <to
413 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Add policies to PDP group')" />
414 <setBody>
415 <simple>${exchangeProperty[loopObject].getComponent("POLICY").createPoliciesPayloadPdpGroup(exchangeProperty[loopObject])}
416 </simple>
417 </setBody>
418 <setHeader headerName="CamelHttpMethod">
419 <constant>POST</constant>
420 </setHeader>
421 <setHeader headerName="Content-Type">
422 <constant>application/json</constant>
423 </setHeader>
424 <setHeader headerName="X-ONAP-RequestID">
425 <simple>${exchangeProperty[X-ONAP-RequestID]}
426 </simple>
427 </setHeader>
428 <setHeader headerName="X-ONAP-InvocationID">
429 <simple>${exchangeProperty[X-ONAP-InvocationID]}
430 </simple>
431 </setHeader>
432 <setHeader headerName="X-ONAP-PartnerName">
433 <simple>${exchangeProperty[X-ONAP-PartnerName]}
434 </simple>
435 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700436 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200437 message="Endpoint to add policies to PDP Group: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies"></log>
438 <toD
sebdet493e9e72019-06-13 12:12:09 +0200439 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 +0200440
441 <doFinally>
442 <to uri="direct:reset-raise-http-exception-flag" />
443 <to
444 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
445 <setProperty propertyName="logMessage">
446 <simple>PDP Group push ALL status</simple>
447 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700448 <setProperty propertyName="logComponent">
449 <simple>POLICY</simple>
450 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200451 <to uri="direct:dump-loop-log-http-response" />
452 </doFinally>
453 </doTry>
454 </route>
455
456 <route id="remove-all-policy-from-active-pdp-group">
457 <from uri="direct:remove-all-policy-from-active-pdp-group" />
458 <doTry>
sebdet5e2b0772019-08-21 15:27:11 -0700459 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200460 message="Removing policies from active PDP group for loop: ${exchangeProperty[loopObject].getName()}" />
461 <to
462 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Removing policies PDP group')" />
463 <split>
464 <simple>${exchangeProperty[loopObject].getComponent("POLICY").listPolicyNamesPdpGroup(exchangeProperty[loopObject])}
465 </simple>
466 <setProperty propertyName="policyName">
467 <simple>${body}</simple>
468 </setProperty>
469 <setBody>
470 <constant>null</constant>
471 </setBody>
472 <setHeader headerName="CamelHttpMethod">
473 <constant>DELETE</constant>
474 </setHeader>
475 <setHeader headerName="X-ONAP-RequestID">
476 <simple>${exchangeProperty[X-ONAP-RequestID]}
477 </simple>
478 </setHeader>
479 <setHeader headerName="X-ONAP-InvocationID">
480 <simple>${exchangeProperty[X-ONAP-InvocationID]}
481 </simple>
482 </setHeader>
483 <setHeader headerName="X-ONAP-PartnerName">
484 <simple>${exchangeProperty[X-ONAP-PartnerName]}
485 </simple>
486 </setHeader>
sebdet5e2b0772019-08-21 15:27:11 -0700487 <log loggingLevel="INFO"
sebdet09bc8452019-05-23 17:34:07 +0200488 message="Endpoint to delete policy from PDP Group: {{clamp.config.policy.pap.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0"></log>
489 <toD
sebdet493e9e72019-06-13 12:12:09 +0200490 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 +0200491 <setProperty propertyName="logMessage">
492 <simple>${exchangeProperty[policyName]} PDP Group removal status
493 </simple>
494 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700495 <setProperty propertyName="logComponent">
496 <simple>POLICY</simple>
497 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200498 <to uri="direct:dump-loop-log-http-response" />
499 </split>
500 <doCatch>
501 <exception>java.lang.Exception</exception>
502 <handled>
503 <constant>false</constant>
504 </handled>
505 <setProperty propertyName="logMessage">
506 <simple>PDP Group removal, Error reported: ${exception}</simple>
507 </setProperty>
sebdet5e2b0772019-08-21 15:27:11 -0700508 <setProperty propertyName="logComponent">
509 <simple>POLICY</simple>
510 </setProperty>
sebdet09bc8452019-05-23 17:34:07 +0200511 <to uri="direct:dump-loop-log-http-response" />
512 </doCatch>
513 <doFinally>
514 <to uri="direct:reset-raise-http-exception-flag" />
515 <to
516 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
517 </doFinally>
518 </doTry>
519 </route>
520</routes>