1 <routes xmlns="http://camel.apache.org/schema/spring">
3 <from uri="direct:processSubmit" />
6 <simple> ${exchangeProperty.actionCd} == 'SUBMIT' ||
7 ${exchangeProperty.actionCd} == 'RESUBMIT'
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" />
14 <constant>30000</constant>
17 uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" />
18 <to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" />
20 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
23 <simple> ${exchangeProperty.actionCd} == 'DELETE'</simple>
25 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
26 <to uri="bean:org.onap.clamp.clds.client.TcaPolicyDeleteDelegate" />
28 uri="bean:org.onap.clamp.clds.client.HolmesPolicyDeleteDelegate" />
30 <constant>30000</constant>
33 uri="bean:org.onap.clamp.clds.client.OperationalPolicyDeleteDelegate" />
35 uri="bean:org.onap.clamp.clds.client.GuardPolicyDeleteDelegate" />
36 <to uri="bean:org.onap.clamp.clds.client.ModelDeleteDelegate" />
38 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
41 <simple> ${exchangeProperty.actionCd} == 'UPDATE'</simple>
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" />
47 <constant>30000</constant>
50 uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" />
51 <to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" />
53 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
56 <simple> ${exchangeProperty.actionCd} == 'STOP'</simple>
58 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
60 uri="bean:org.onap.clamp.clds.client.OperationalPolicyDeleteDelegate" />
62 uri="bean:org.onap.clamp.clds.client.GuardPolicyDeleteDelegate" />
64 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
67 <simple> ${exchangeProperty.actionCd} == 'RESTART'</simple>
69 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
70 <to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" />
72 uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" />
74 uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
79 <route id="load-loop">
80 <from uri="direct:load-loop" />
81 <setHeader headerName="LoopObject">
83 ref="org.onap.clamp.loop.LoopService"
88 <simple>${header.LoopObject} == null</simple>
89 <setHeader headerName="CamelHttpResponseCode">
90 <constant>404</constant>
93 loggingLevel="WARNING"
94 message="Loop not found in database: ${body}" />
100 <route id="create-micro-service-policy">
101 <from uri="direct:create-micro-service-policy" />
104 message="Creating Micro Service Policy: ${header.microServicePolicy.getName()}" />
106 <simple>${header.microServicePolicy.createPolicyPayload()}
109 <setHeader headerName="CamelHttpMethod">
110 <constant>POST</constant>
112 <setHeader headerName="Content-Type">
113 <constant>application/json</constant>
115 <setHeader headerName="CamelHttpUri">
116 <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies
121 message="Endpoint to create microservice policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
123 uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}" />
125 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy created successfully','INFO',${header.LoopObject})" />
127 <route id="delete-micro-service-policy">
128 <from uri="direct:delete-micro-service-policy" />
131 message="Deleting Micro Service Policy: ${header.microServicePolicy.getName()}" />
133 <constant>null</constant>
135 <setHeader headerName="CamelHttpMethod">
136 <constant>DELETE</constant>
138 <setHeader headerName="CamelHttpUri">
139 <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies/${header.microServicePolicy.getName()}
144 message="Endpoint to delete microservice policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
146 uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" />
148 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy deleted successfully','INFO',${header.LoopObject})" />
151 <route id="create-operational-policy">
152 <from uri="direct:create-operational-policy" />
155 message="Creating Operational Policy: ${header.operationalPolicy.getName()}" />
157 <simple>${header.operationalPolicy.createPolicyPayload()}
160 <setHeader headerName="CamelHttpMethod">
161 <constant>POST</constant>
163 <setHeader headerName="Content-Type">
164 <constant>application/yaml; legacy-version</constant>
166 <setHeader headerName="CamelHttpUri">
167 <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies
172 message="Endpoint to create operational policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
174 uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}" />
176 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy created successfully','INFO',${header.LoopObject})" />
178 <route id="delete-operational-policy">
179 <from uri="direct:delete-operational-policy" />
182 message="Deleting Operational Policy: ${header.operationalPolicy.getName()}" />
184 <constant>null</constant>
186 <setHeader headerName="CamelHttpMethod">
187 <constant>DELETE</constant>
189 <setHeader headerName="CamelHttpUri">
190 <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies/${header.operationalPolicy.getName()}
195 message="Endpoint to delete operational policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
197 uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" />
199 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy deleted successfully','INFO',${header.LoopObject})" />
202 <route id="create-guard-policy">
203 <from uri="direct:create-guard-policy" />
206 message="Creating Guard Policy: ${header.guardPolicy.getKey()}" />
208 <simple>${header.guardPolicy.getValue()}
211 <setHeader headerName="CamelHttpMethod">
212 <constant>POST</constant>
214 <setHeader headerName="Content-Type">
215 <constant>application/json</constant>
217 <setHeader headerName="CamelHttpUri">
218 <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies
223 message="Endpoint to create guard policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
225 uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}" />
227 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy created successfully','INFO',${header.LoopObject})" />
229 <route id="delete-guard-policy">
230 <from uri="direct:delete-guard-policy" />
233 message="Deleting Guard Policy: ${header.guardPolicy.getKey()}" />
235 <constant>null</constant>
237 <setHeader headerName="CamelHttpMethod">
238 <constant>DELETE</constant>
240 <setHeader headerName="CamelHttpUri">
241 <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${header.guardPolicy.getKey()}
246 message="Endpoint to delete guard policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
248 uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" />
250 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy deleted successfully','INFO',${header.LoopObject})" />
253 <route id="create-pdp-group-policy">
254 <from uri="direct:create-pdp-group-policy" />
257 message="Creating PDP Group Policy: ${header.guardPolicy.getKey()}" />
259 <simple>${header.LoopObject.createPoliciesPayloadPdpGroup()}
262 <setHeader headerName="CamelHttpMethod">
263 <constant>POST</constant>
265 <setHeader headerName="Content-Type">
266 <constant>application/json</constant>
268 <setHeader headerName="CamelHttpUri">
269 <simple>{{clamp.config.policy.url}}/policy/pap/v1/pdps
274 message="Endpoint to create PDP Group policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
276 uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}" />
278 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Pdp Group created successfully','INFO',${header.LoopObject})" />