Determe, Sebastien (sd378r) | 7c08374 | 2018-02-14 15:31:55 +0100 | [diff] [blame] | 1 | <routes xmlns="http://camel.apache.org/schema/spring"> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 2 | <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> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 78 | |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 79 | <route id="load-loop"> |
| 80 | <from uri="direct:load-loop" /> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame] | 81 | <setBody> |
| 82 | <simple>${header.loopName}</simple> |
| 83 | </setBody> |
sebdet | 338c218 | 2019-04-25 12:33:31 +0200 | [diff] [blame] | 84 | <setProperty propertyName="loopObject"> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 85 | <method |
| 86 | ref="org.onap.clamp.loop.LoopService" |
| 87 | method="getLoop" /> |
sebdet | 338c218 | 2019-04-25 12:33:31 +0200 | [diff] [blame] | 88 | </setProperty> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 89 | |
| 90 | <when> |
sebdet | 338c218 | 2019-04-25 12:33:31 +0200 | [diff] [blame] | 91 | <simple>${exchangeProperty[loopObject]} == null</simple> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 92 | <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> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 100 | </route> |
sebdet | 338c218 | 2019-04-25 12:33:31 +0200 | [diff] [blame] | 101 | |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 102 | <route id="create-micro-service-policy"> |
| 103 | <from uri="direct:create-micro-service-policy" /> |
sebdet | 373b07b | 2019-04-26 12:04:26 +0200 | [diff] [blame] | 104 | <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" |
| 134 | message="Endpoint to create microservice policy: {{clamp.config.policy.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies"></log> |
| 135 | <toD |
| 136 | uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> |
| 137 | <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> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 149 | </route> |
sebdet | 338c218 | 2019-04-25 12:33:31 +0200 | [diff] [blame] | 150 | |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 151 | <route id="delete-micro-service-policy"> |
| 152 | <from uri="direct:delete-micro-service-policy" /> |
sebdet | 373b07b | 2019-04-26 12:04:26 +0200 | [diff] [blame] | 153 | <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')" /> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame] | 159 | <setBody> |
| 160 | <constant>null</constant> |
| 161 | </setBody> |
| 162 | <setHeader headerName="CamelHttpMethod"> |
| 163 | <constant>DELETE</constant> |
| 164 | </setHeader> |
xg353y | 9ac3070 | 2019-04-19 13:55:40 +0200 | [diff] [blame] | 165 | <setHeader headerName="X-ONAP-RequestID"> |
sebdet | 338c218 | 2019-04-25 12:33:31 +0200 | [diff] [blame] | 166 | <simple>${exchangeProperty[X-ONAP-RequestID]} |
xg353y | 9ac3070 | 2019-04-19 13:55:40 +0200 | [diff] [blame] | 167 | </simple> |
| 168 | </setHeader> |
| 169 | <setHeader headerName="X-ONAP-InvocationID"> |
sebdet | 338c218 | 2019-04-25 12:33:31 +0200 | [diff] [blame] | 170 | <simple>${exchangeProperty[X-ONAP-InvocationID]} |
xg353y | 9ac3070 | 2019-04-19 13:55:40 +0200 | [diff] [blame] | 171 | </simple> |
| 172 | </setHeader> |
| 173 | <setHeader headerName="X-ONAP-PartnerName"> |
sebdet | 338c218 | 2019-04-25 12:33:31 +0200 | [diff] [blame] | 174 | <simple>${exchangeProperty[X-ONAP-PartnerName]} |
xg353y | 9ac3070 | 2019-04-19 13:55:40 +0200 | [diff] [blame] | 175 | </simple> |
| 176 | </setHeader> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame] | 177 | <log |
| 178 | loggingLevel="INFO" |
sebdet | 373b07b | 2019-04-26 12:04:26 +0200 | [diff] [blame] | 179 | message="Endpoint to delete microservice policy: {{clamp.config.policy.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}"></log> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame] | 180 | <toD |
sebdet | 373b07b | 2019-04-26 12:04:26 +0200 | [diff] [blame] | 181 | uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> |
| 182 | |
| 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()}" /> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame] | 203 | <to |
sebdet | 373b07b | 2019-04-26 12:04:26 +0200 | [diff] [blame] | 204 | 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"> |
sebdet | 5415b26 | 2019-04-26 13:04:08 +0200 | [diff] [blame] | 213 | <constant>application/json</constant> |
sebdet | 373b07b | 2019-04-26 12:04:26 +0200 | [diff] [blame] | 214 | </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" |
| 229 | message="Endpoint to create operational policy: {{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policy.controlloop.operational/versions/1.0.0/policies"></log> |
| 230 | <toD |
| 231 | uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policy.controlloop.operational/versions/1.0.0/policies?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> |
| 232 | <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" |
| 274 | message="Endpoint to delete operational policy: {{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policy.controlloop.operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}"></log> |
| 275 | <toD |
| 276 | uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policy.controlloop.operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> |
| 277 | <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" |
| 323 | message="Endpoint to create guard policy: {{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policy.controlloop.Guard/versions/1.0.0/policies"></log> |
| 324 | <toD |
| 325 | uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policy.controlloop.Guard/versions/1.0.0/policies?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> |
| 326 | <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" |
| 367 | message="Endpoint to delete guard policy: {{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policy.controlloop.Guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}"></log> |
| 368 | <toD |
| 369 | uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policy.controlloop.Guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}?bridgeEndpoint=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> |
| 370 | |
| 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" |
| 416 | message="Endpoint to add policies to PDP Group: {{clamp.config.policy.url}}/policy/pap/v1/pdps"></log> |
| 417 | <toD |
| 418 | uri="{{clamp.config.policy.url}}/policy/pap/v1/pdps?throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authMethod=Basic&authUsername=test&authPassword=test" /> |
| 419 | |
| 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" |
| 466 | message="Endpoint to delete policy from PDP Group: {{clamp.config.policy.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0"></log> |
| 467 | <toD |
| 468 | uri="{{clamp.config.policy.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> |
| 469 | <setProperty propertyName="logMessage"> |
| 470 | <simple>${exchangeProperty[policyName]} PDP Group removal status |
| 471 | </simple> |
| 472 | </setProperty> |
| 473 | <to uri="direct:dump-loop-log-http-response" /> |
| 474 | </split> |
| 475 | <doCatch> |
| 476 | <exception>java.lang.Exception</exception> |
| 477 | <handled> |
| 478 | <constant>false</constant> |
| 479 | </handled> |
| 480 | <setProperty propertyName="logMessage"> |
| 481 | <simple>${exchangeProperty[policyName]} PDP Group removal status |
| 482 | </simple> |
| 483 | </setProperty> |
| 484 | <to uri="direct:dump-loop-log-http-response" /> |
| 485 | </doCatch> |
| 486 | <doFinally> |
| 487 | <to uri="direct:reset-raise-http-exception-flag" /> |
| 488 | <to |
| 489 | uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> |
| 490 | </doFinally> |
| 491 | </doTry> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame] | 492 | </route> |
sebdet | 338c218 | 2019-04-25 12:33:31 +0200 | [diff] [blame] | 493 | |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame] | 494 | <route id="reset-raise-http-exception-flag"> |
| 495 | <from uri="direct:reset-raise-http-exception-flag" /> |
sebdet | 338c218 | 2019-04-25 12:33:31 +0200 | [diff] [blame] | 496 | <setProperty propertyName="raiseHttpExceptionFlag"> |
sebdet | 1efe60f | 2019-04-11 17:58:36 +0200 | [diff] [blame] | 497 | <simple resultType="java.lang.Boolean">true</simple> |
sebdet | 338c218 | 2019-04-25 12:33:31 +0200 | [diff] [blame] | 498 | </setProperty> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 499 | </route> |
sebdet | 373b07b | 2019-04-26 12:04:26 +0200 | [diff] [blame] | 500 | |
| 501 | <route id="dump-loop-log-http-response"> |
| 502 | <from uri="direct:dump-loop-log-http-response" /> |
| 503 | <to |
| 504 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog(${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText},'INFO',${exchangeProperty[loopObject]})" /> |
| 505 | </route> |
Determe, Sebastien (sd378r) | 7c08374 | 2018-02-14 15:31:55 +0100 | [diff] [blame] | 506 | </routes> |