sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 1 | |
| 2 | <routes xmlns="http://camel.apache.org/schema/spring"> |
sebdet | 3142c70 | 2019-08-23 07:45:27 -0700 | [diff] [blame^] | 3 | <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 | |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 34 | <route id="get-policy"> |
| 35 | <from uri="direct:get-policy" /> |
| 36 | <doTry> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 37 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 38 | 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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 56 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 57 | 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 |
sebdet | 493e9e7 | 2019-06-13 12:12:09 +0200 | [diff] [blame] | 59 | 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&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true" /> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 60 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 69 | <setProperty propertyName="logComponent"> |
| 70 | <simple>POLICY</simple> |
| 71 | </setProperty> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 72 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 80 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 81 | 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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 99 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 100 | 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 |
sebdet | 493e9e7 | 2019-06-13 12:12:09 +0200 | [diff] [blame] | 102 | uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyType]}/versions/1.0.0/policies/${exchangeProperty[policyName]}/versions/deployed?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true" /> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 103 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 112 | <setProperty propertyName="logComponent"> |
| 113 | <simple>POLICY</simple> |
| 114 | </setProperty> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 115 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 122 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 123 | 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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 148 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 149 | 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 |
sebdet | 493e9e7 | 2019-06-13 12:12:09 +0200 | [diff] [blame] | 151 | uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true" /> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 152 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 161 | <setProperty propertyName="logComponent"> |
| 162 | <simple>POLICY</simple> |
| 163 | </setProperty> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 164 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 172 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 173 | 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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 194 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 195 | 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 |
sebdet | 493e9e7 | 2019-06-13 12:12:09 +0200 | [diff] [blame] | 197 | 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&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true" /> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 198 | |
| 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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 208 | <setProperty propertyName="logComponent"> |
| 209 | <simple>POLICY</simple> |
| 210 | </setProperty> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 211 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 219 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 220 | 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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 245 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 246 | 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 |
sebdet | 493e9e7 | 2019-06-13 12:12:09 +0200 | [diff] [blame] | 248 | uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true" /> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 249 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 258 | <setProperty propertyName="logComponent"> |
| 259 | <simple>POLICY</simple> |
| 260 | </setProperty> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 261 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 269 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 270 | 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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 291 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 292 | 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 |
sebdet | 493e9e7 | 2019-06-13 12:12:09 +0200 | [diff] [blame] | 294 | 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&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true" /> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 295 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 304 | <setProperty propertyName="logComponent"> |
| 305 | <simple>POLICY</simple> |
| 306 | </setProperty> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 307 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 315 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 316 | 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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 341 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 342 | 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 |
sebdet | 493e9e7 | 2019-06-13 12:12:09 +0200 | [diff] [blame] | 344 | uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true" /> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 345 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 353 | <setProperty propertyName="logComponent"> |
| 354 | <simple>POLICY</simple> |
| 355 | </setProperty> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 356 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 364 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 365 | 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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 386 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 387 | 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 |
sebdet | 493e9e7 | 2019-06-13 12:12:09 +0200 | [diff] [blame] | 389 | 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&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true" /> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 390 | |
| 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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 399 | <setProperty propertyName="logComponent"> |
| 400 | <simple>POLICY</simple> |
| 401 | </setProperty> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 402 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 410 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 411 | 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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 436 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 437 | message="Endpoint to add policies to PDP Group: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies"></log> |
| 438 | <toD |
sebdet | 493e9e7 | 2019-06-13 12:12:09 +0200 | [diff] [blame] | 439 | uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies?bridgeEndpoint=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&useSystemProperties=true&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true" /> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 440 | |
| 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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 448 | <setProperty propertyName="logComponent"> |
| 449 | <simple>POLICY</simple> |
| 450 | </setProperty> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 451 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 459 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 460 | 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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 487 | <log loggingLevel="INFO" |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 488 | message="Endpoint to delete policy from PDP Group: {{clamp.config.policy.pap.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0"></log> |
| 489 | <toD |
sebdet | 493e9e7 | 2019-06-13 12:12:09 +0200 | [diff] [blame] | 490 | uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true" /> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 491 | <setProperty propertyName="logMessage"> |
| 492 | <simple>${exchangeProperty[policyName]} PDP Group removal status |
| 493 | </simple> |
| 494 | </setProperty> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 495 | <setProperty propertyName="logComponent"> |
| 496 | <simple>POLICY</simple> |
| 497 | </setProperty> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 498 | <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> |
sebdet | 5e2b077 | 2019-08-21 15:27:11 -0700 | [diff] [blame] | 508 | <setProperty propertyName="logComponent"> |
| 509 | <simple>POLICY</simple> |
| 510 | </setProperty> |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 511 | <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> |