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 | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 84 | <setHeader headerName="LoopObject"> |
| 85 | <method |
| 86 | ref="org.onap.clamp.loop.LoopService" |
| 87 | method="getLoop" /> |
| 88 | </setHeader> |
| 89 | |
| 90 | <when> |
| 91 | <simple>${header.LoopObject} == null</simple> |
| 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> |
| 101 | |
| 102 | <route id="create-micro-service-policy"> |
| 103 | <from uri="direct:create-micro-service-policy" /> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 104 | <to uri="direct:check-raise-http-exception-flag" /> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 105 | <log |
| 106 | loggingLevel="INFO" |
| 107 | message="Creating Micro Service Policy: ${header.microServicePolicy.getName()}" /> |
| 108 | <setBody> |
| 109 | <simple>${header.microServicePolicy.createPolicyPayload()} |
| 110 | </simple> |
| 111 | </setBody> |
| 112 | <setHeader headerName="CamelHttpMethod"> |
| 113 | <constant>POST</constant> |
| 114 | </setHeader> |
| 115 | <setHeader headerName="Content-Type"> |
| 116 | <constant>application/json</constant> |
| 117 | </setHeader> |
| 118 | <setHeader headerName="CamelHttpUri"> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 119 | <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 120 | </simple> |
| 121 | </setHeader> |
| 122 | <log |
| 123 | loggingLevel="INFO" |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 124 | message="Endpoint to create microservice policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 125 | <toD |
sebdet | ece804b | 2019-04-10 15:29:16 +0200 | [diff] [blame] | 126 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 127 | <to |
| 128 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy created successfully','INFO',${header.LoopObject})" /> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 129 | <to uri="direct:reset-raise-http-exception-flag" /> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 130 | </route> |
| 131 | <route id="delete-micro-service-policy"> |
| 132 | <from uri="direct:delete-micro-service-policy" /> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 133 | <to uri="direct:check-raise-http-exception-flag" /> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 134 | <log |
| 135 | loggingLevel="INFO" |
| 136 | message="Deleting Micro Service Policy: ${header.microServicePolicy.getName()}" /> |
| 137 | <setBody> |
| 138 | <constant>null</constant> |
| 139 | </setBody> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 140 | <setHeader headerName="CamelHttpMethod"> |
| 141 | <constant>DELETE</constant> |
| 142 | </setHeader> |
| 143 | <setHeader headerName="CamelHttpUri"> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 144 | <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies/${header.microServicePolicy.getName()} |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 145 | </simple> |
| 146 | </setHeader> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 147 | <log |
| 148 | loggingLevel="INFO" |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 149 | message="Endpoint to delete microservice policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 150 | <toD |
sebdet | ece804b | 2019-04-10 15:29:16 +0200 | [diff] [blame] | 151 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 152 | <to |
| 153 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy deleted successfully','INFO',${header.LoopObject})" /> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 154 | <to uri="direct:reset-raise-http-exception-flag" /> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 155 | </route> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 156 | |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 157 | <route id="create-operational-policy"> |
| 158 | <from uri="direct:create-operational-policy" /> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 159 | <to uri="direct:check-raise-http-exception-flag" /> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 160 | <log |
| 161 | loggingLevel="INFO" |
| 162 | message="Creating Operational Policy: ${header.operationalPolicy.getName()}" /> |
| 163 | <setBody> |
| 164 | <simple>${header.operationalPolicy.createPolicyPayload()} |
| 165 | </simple> |
| 166 | </setBody> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 167 | <setHeader headerName="CamelHttpMethod"> |
| 168 | <constant>POST</constant> |
| 169 | </setHeader> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 170 | <setHeader headerName="Content-Type"> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 171 | <constant>application/yaml; legacy-version</constant> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 172 | </setHeader> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 173 | <setHeader headerName="CamelHttpUri"> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 174 | <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 175 | </simple> |
| 176 | </setHeader> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 177 | <log |
| 178 | loggingLevel="INFO" |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 179 | message="Endpoint to create operational policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 180 | <toD |
sebdet | ece804b | 2019-04-10 15:29:16 +0200 | [diff] [blame] | 181 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 182 | <to |
| 183 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy created successfully','INFO',${header.LoopObject})" /> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 184 | <to uri="direct:reset-raise-http-exception-flag" /> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 185 | </route> |
| 186 | <route id="delete-operational-policy"> |
| 187 | <from uri="direct:delete-operational-policy" /> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 188 | <to uri="direct:check-raise-http-exception-flag" /> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 189 | <log |
| 190 | loggingLevel="INFO" |
| 191 | message="Deleting Operational Policy: ${header.operationalPolicy.getName()}" /> |
| 192 | <setBody> |
| 193 | <constant>null</constant> |
| 194 | </setBody> |
| 195 | <setHeader headerName="CamelHttpMethod"> |
| 196 | <constant>DELETE</constant> |
| 197 | </setHeader> |
| 198 | <setHeader headerName="CamelHttpUri"> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 199 | <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies/${header.operationalPolicy.getName()} |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 200 | </simple> |
| 201 | </setHeader> |
| 202 | <log |
| 203 | loggingLevel="INFO" |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 204 | message="Endpoint to delete operational policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 205 | <toD |
sebdet | ece804b | 2019-04-10 15:29:16 +0200 | [diff] [blame] | 206 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 207 | <to |
| 208 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy deleted successfully','INFO',${header.LoopObject})" /> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 209 | <to uri="direct:reset-raise-http-exception-flag" /> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 210 | </route> |
| 211 | |
| 212 | <route id="create-guard-policy"> |
| 213 | <from uri="direct:create-guard-policy" /> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 214 | <to uri="direct:check-raise-http-exception-flag" /> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 215 | <log |
| 216 | loggingLevel="INFO" |
| 217 | message="Creating Guard Policy: ${header.guardPolicy.getKey()}" /> |
| 218 | <setBody> |
| 219 | <simple>${header.guardPolicy.getValue()} |
| 220 | </simple> |
| 221 | </setBody> |
| 222 | <setHeader headerName="CamelHttpMethod"> |
| 223 | <constant>POST</constant> |
| 224 | </setHeader> |
| 225 | <setHeader headerName="Content-Type"> |
| 226 | <constant>application/json</constant> |
| 227 | </setHeader> |
| 228 | <setHeader headerName="CamelHttpUri"> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 229 | <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 230 | </simple> |
| 231 | </setHeader> |
| 232 | <log |
| 233 | loggingLevel="INFO" |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 234 | message="Endpoint to create guard policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 235 | <toD |
sebdet | ece804b | 2019-04-10 15:29:16 +0200 | [diff] [blame] | 236 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 237 | <to |
| 238 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy created successfully','INFO',${header.LoopObject})" /> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 239 | <to uri="direct:reset-raise-http-exception-flag" /> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 240 | </route> |
| 241 | <route id="delete-guard-policy"> |
| 242 | <from uri="direct:delete-guard-policy" /> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 243 | <to uri="direct:check-raise-http-exception-flag" /> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 244 | <log |
| 245 | loggingLevel="INFO" |
| 246 | message="Deleting Guard Policy: ${header.guardPolicy.getKey()}" /> |
| 247 | <setBody> |
| 248 | <constant>null</constant> |
| 249 | </setBody> |
| 250 | <setHeader headerName="CamelHttpMethod"> |
| 251 | <constant>DELETE</constant> |
| 252 | </setHeader> |
| 253 | <setHeader headerName="CamelHttpUri"> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 254 | <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${header.guardPolicy.getKey()} |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 255 | </simple> |
| 256 | </setHeader> |
| 257 | <log |
| 258 | loggingLevel="INFO" |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 259 | message="Endpoint to delete guard policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 260 | <toD |
sebdet | ece804b | 2019-04-10 15:29:16 +0200 | [diff] [blame] | 261 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 262 | <to |
| 263 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy deleted successfully','INFO',${header.LoopObject})" /> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 264 | <to uri="direct:reset-raise-http-exception-flag" /> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 265 | </route> |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 266 | <route id="add-all-to-active-pdp-group"> |
| 267 | <from uri="direct:add-all-to-active-pdp-group" /> |
| 268 | <to uri="direct:check-raise-http-exception-flag" /> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 269 | <log |
| 270 | loggingLevel="INFO" |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 271 | message="Adding loop policies to PDP Group: ${header.LoopObject.getName()}" /> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 272 | <setBody> |
| 273 | <simple>${header.LoopObject.createPoliciesPayloadPdpGroup()} |
| 274 | </simple> |
| 275 | </setBody> |
| 276 | <setHeader headerName="CamelHttpMethod"> |
| 277 | <constant>POST</constant> |
| 278 | </setHeader> |
| 279 | <setHeader headerName="Content-Type"> |
| 280 | <constant>application/json</constant> |
| 281 | </setHeader> |
| 282 | <setHeader headerName="CamelHttpUri"> |
| 283 | <simple>{{clamp.config.policy.url}}/policy/pap/v1/pdps |
| 284 | </simple> |
| 285 | </setHeader> |
| 286 | <log |
| 287 | loggingLevel="INFO" |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 288 | message="Endpoint to add policies to PDP Group: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 289 | <toD |
sebdet | ece804b | 2019-04-10 15:29:16 +0200 | [diff] [blame] | 290 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 291 | <to |
sebdet | 667cb72 | 2019-04-11 02:07:44 +0200 | [diff] [blame^] | 292 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Policies pushed to PDP Group successfully','INFO',${header.LoopObject})" /> |
| 293 | <to uri="direct:reset-raise-http-exception-flag" /> |
| 294 | </route> |
| 295 | |
| 296 | <route id="remove-all-policy-from-active-pdp-group"> |
| 297 | <from uri="direct:remove-all-policy-from-active-pdp-group" /> |
| 298 | <to uri="direct:check-raise-http-exception-flag" /> |
| 299 | <log |
| 300 | loggingLevel="INFO" |
| 301 | message="Removing policies from active PDP group for loop: ${header.LoopObject.getName()}" /> |
| 302 | <split> |
| 303 | <simple>${header.LoopObject.listPolicyNamesPdpGroup()}</simple> |
| 304 | <setHeader headerName="PolicyName"> |
| 305 | <simple>${body}</simple> |
| 306 | </setHeader> |
| 307 | <setBody> |
| 308 | <constant>null</constant> |
| 309 | </setBody> |
| 310 | <setHeader headerName="CamelHttpMethod"> |
| 311 | <constant>DELETE</constant> |
| 312 | </setHeader> |
| 313 | <setHeader headerName="CamelHttpUri"> |
| 314 | <simple>{{clamp.config.policy.url}}/pdps/policies/${header.PolicyName}/versions/1.0.0 |
| 315 | </simple> |
| 316 | </setHeader> |
| 317 | <log |
| 318 | loggingLevel="INFO" |
| 319 | message="Endpoint to delete policy from PDP Group: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
| 320 | <toD |
| 321 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> |
| 322 | <to |
| 323 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog(${header.PolicyName}' Policy removed from PDP Group successfully','INFO',${header.LoopObject})" /> |
| 324 | </split> |
| 325 | <to uri="direct:reset-raise-http-exception-flag" /> |
| 326 | </route> |
| 327 | |
| 328 | <route id="check-raise-http-exception-flag"> |
| 329 | <from uri="direct:check-raise-http-exception-flag" /> |
| 330 | <when> |
| 331 | <simple>${header.RaiseHttpExceptionFlag} == null</simple> |
| 332 | <setHeader headerName="RaiseHttpExceptionFlag"> |
| 333 | <simple resultType="java.lang.Boolean">true</simple> |
| 334 | </setHeader> |
| 335 | </when> |
| 336 | </route> |
| 337 | |
| 338 | <route id="reset-raise-http-exception-flag"> |
| 339 | <from uri="direct:reset-raise-http-exception-flag" /> |
| 340 | <setHeader headerName="RaiseHttpExceptionFlag"> |
| 341 | <constant>null</constant> |
| 342 | </setHeader> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 343 | </route> |
Determe, Sebastien (sd378r) | 7c08374 | 2018-02-14 15:31:55 +0100 | [diff] [blame] | 344 | </routes> |