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" /> |
| 81 | <setHeader headerName="LoopObject"> |
| 82 | <method |
| 83 | ref="org.onap.clamp.loop.LoopService" |
| 84 | method="getLoop" /> |
| 85 | </setHeader> |
| 86 | |
| 87 | <when> |
| 88 | <simple>${header.LoopObject} == null</simple> |
| 89 | <setHeader headerName="CamelHttpResponseCode"> |
| 90 | <constant>404</constant> |
| 91 | </setHeader> |
| 92 | <log |
| 93 | loggingLevel="WARNING" |
| 94 | message="Loop not found in database: ${body}" /> |
| 95 | <stop /> |
| 96 | </when> |
| 97 | |
| 98 | </route> |
| 99 | |
| 100 | <route id="create-micro-service-policy"> |
| 101 | <from uri="direct:create-micro-service-policy" /> |
| 102 | <log |
| 103 | loggingLevel="INFO" |
| 104 | message="Creating Micro Service Policy: ${header.microServicePolicy.getName()}" /> |
| 105 | <setBody> |
| 106 | <simple>${header.microServicePolicy.createPolicyPayload()} |
| 107 | </simple> |
| 108 | </setBody> |
| 109 | <setHeader headerName="CamelHttpMethod"> |
| 110 | <constant>POST</constant> |
| 111 | </setHeader> |
| 112 | <setHeader headerName="Content-Type"> |
| 113 | <constant>application/json</constant> |
| 114 | </setHeader> |
| 115 | <setHeader headerName="CamelHttpUri"> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 116 | <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] | 117 | </simple> |
| 118 | </setHeader> |
| 119 | <log |
| 120 | loggingLevel="INFO" |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 121 | message="Endpoint to create microservice policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 122 | <toD |
sebdet | cd64cc4 | 2019-04-10 14:07:35 +0200 | [diff] [blame^] | 123 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}" /> |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 124 | <to |
| 125 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy created successfully','INFO',${header.LoopObject})" /> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 126 | </route> |
| 127 | <route id="delete-micro-service-policy"> |
| 128 | <from uri="direct:delete-micro-service-policy" /> |
| 129 | <log |
| 130 | loggingLevel="INFO" |
| 131 | message="Deleting Micro Service Policy: ${header.microServicePolicy.getName()}" /> |
| 132 | <setBody> |
| 133 | <constant>null</constant> |
| 134 | </setBody> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 135 | <setHeader headerName="CamelHttpMethod"> |
| 136 | <constant>DELETE</constant> |
| 137 | </setHeader> |
| 138 | <setHeader headerName="CamelHttpUri"> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 139 | <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] | 140 | </simple> |
| 141 | </setHeader> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 142 | <log |
| 143 | loggingLevel="INFO" |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 144 | message="Endpoint to delete microservice policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 145 | <toD |
sebdet | cd64cc4 | 2019-04-10 14:07:35 +0200 | [diff] [blame^] | 146 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 147 | <to |
| 148 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy deleted successfully','INFO',${header.LoopObject})" /> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 149 | </route> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 150 | |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 151 | <route id="create-operational-policy"> |
| 152 | <from uri="direct:create-operational-policy" /> |
| 153 | <log |
| 154 | loggingLevel="INFO" |
| 155 | message="Creating Operational Policy: ${header.operationalPolicy.getName()}" /> |
| 156 | <setBody> |
| 157 | <simple>${header.operationalPolicy.createPolicyPayload()} |
| 158 | </simple> |
| 159 | </setBody> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 160 | <setHeader headerName="CamelHttpMethod"> |
| 161 | <constant>POST</constant> |
| 162 | </setHeader> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 163 | <setHeader headerName="Content-Type"> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 164 | <constant>application/yaml; legacy-version</constant> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 165 | </setHeader> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 166 | <setHeader headerName="CamelHttpUri"> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 167 | <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] | 168 | </simple> |
| 169 | </setHeader> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 170 | <log |
| 171 | loggingLevel="INFO" |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 172 | message="Endpoint to create operational policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 173 | <toD |
sebdet | cd64cc4 | 2019-04-10 14:07:35 +0200 | [diff] [blame^] | 174 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}" /> |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 175 | <to |
| 176 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy created successfully','INFO',${header.LoopObject})" /> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 177 | </route> |
| 178 | <route id="delete-operational-policy"> |
| 179 | <from uri="direct:delete-operational-policy" /> |
| 180 | <log |
| 181 | loggingLevel="INFO" |
| 182 | message="Deleting Operational Policy: ${header.operationalPolicy.getName()}" /> |
| 183 | <setBody> |
| 184 | <constant>null</constant> |
| 185 | </setBody> |
| 186 | <setHeader headerName="CamelHttpMethod"> |
| 187 | <constant>DELETE</constant> |
| 188 | </setHeader> |
| 189 | <setHeader headerName="CamelHttpUri"> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 190 | <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] | 191 | </simple> |
| 192 | </setHeader> |
| 193 | <log |
| 194 | loggingLevel="INFO" |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 195 | message="Endpoint to delete operational policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 196 | <toD |
sebdet | cd64cc4 | 2019-04-10 14:07:35 +0200 | [diff] [blame^] | 197 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 198 | <to |
| 199 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy deleted successfully','INFO',${header.LoopObject})" /> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 200 | </route> |
| 201 | |
| 202 | <route id="create-guard-policy"> |
| 203 | <from uri="direct:create-guard-policy" /> |
| 204 | <log |
| 205 | loggingLevel="INFO" |
| 206 | message="Creating Guard Policy: ${header.guardPolicy.getKey()}" /> |
| 207 | <setBody> |
| 208 | <simple>${header.guardPolicy.getValue()} |
| 209 | </simple> |
| 210 | </setBody> |
| 211 | <setHeader headerName="CamelHttpMethod"> |
| 212 | <constant>POST</constant> |
| 213 | </setHeader> |
| 214 | <setHeader headerName="Content-Type"> |
| 215 | <constant>application/json</constant> |
| 216 | </setHeader> |
| 217 | <setHeader headerName="CamelHttpUri"> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 218 | <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] | 219 | </simple> |
| 220 | </setHeader> |
| 221 | <log |
| 222 | loggingLevel="INFO" |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 223 | message="Endpoint to create guard policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 224 | <toD |
sebdet | cd64cc4 | 2019-04-10 14:07:35 +0200 | [diff] [blame^] | 225 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}" /> |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 226 | <to |
| 227 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy created successfully','INFO',${header.LoopObject})" /> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 228 | </route> |
| 229 | <route id="delete-guard-policy"> |
| 230 | <from uri="direct:delete-guard-policy" /> |
| 231 | <log |
| 232 | loggingLevel="INFO" |
| 233 | message="Deleting Guard Policy: ${header.guardPolicy.getKey()}" /> |
| 234 | <setBody> |
| 235 | <constant>null</constant> |
| 236 | </setBody> |
| 237 | <setHeader headerName="CamelHttpMethod"> |
| 238 | <constant>DELETE</constant> |
| 239 | </setHeader> |
| 240 | <setHeader headerName="CamelHttpUri"> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 241 | <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] | 242 | </simple> |
| 243 | </setHeader> |
| 244 | <log |
| 245 | loggingLevel="INFO" |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 246 | message="Endpoint to delete guard policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame] | 247 | <toD |
sebdet | cd64cc4 | 2019-04-10 14:07:35 +0200 | [diff] [blame^] | 248 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> |
sebdet | ea77586 | 2019-04-09 13:08:10 +0200 | [diff] [blame] | 249 | <to |
| 250 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy deleted successfully','INFO',${header.LoopObject})" /> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 251 | </route> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 252 | |
| 253 | <route id="create-pdp-group-policy"> |
| 254 | <from uri="direct:create-pdp-group-policy" /> |
| 255 | <log |
| 256 | loggingLevel="INFO" |
| 257 | message="Creating PDP Group Policy: ${header.guardPolicy.getKey()}" /> |
| 258 | <setBody> |
| 259 | <simple>${header.LoopObject.createPoliciesPayloadPdpGroup()} |
| 260 | </simple> |
| 261 | </setBody> |
| 262 | <setHeader headerName="CamelHttpMethod"> |
| 263 | <constant>POST</constant> |
| 264 | </setHeader> |
| 265 | <setHeader headerName="Content-Type"> |
| 266 | <constant>application/json</constant> |
| 267 | </setHeader> |
| 268 | <setHeader headerName="CamelHttpUri"> |
| 269 | <simple>{{clamp.config.policy.url}}/policy/pap/v1/pdps |
| 270 | </simple> |
| 271 | </setHeader> |
| 272 | <log |
| 273 | loggingLevel="INFO" |
| 274 | message="Endpoint to create PDP Group policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
| 275 | <toD |
sebdet | cd64cc4 | 2019-04-10 14:07:35 +0200 | [diff] [blame^] | 276 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}" /> |
sebdet | eb71d70 | 2019-04-09 18:10:32 +0200 | [diff] [blame] | 277 | <to |
| 278 | uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Pdp Group created successfully','INFO',${header.LoopObject})" /> |
| 279 | </route> |
Determe, Sebastien (sd378r) | 7c08374 | 2018-02-14 15:31:55 +0100 | [diff] [blame] | 280 | </routes> |