blob: b8244990b7f55b9424cd3594640f77dd2ac17c9b [file] [log] [blame]
Determe, Sebastien (sd378r)7c083742018-02-14 15:31:55 +01001<routes xmlns="http://camel.apache.org/schema/spring">
sebdetdfa86ca2019-04-05 15:15:31 +02002 <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>
78 <route id="delete-micro-service">
79 <from uri="direct:delete-micro-service" />
80
81 <setHeader headerName="CamelHttpMethod">
82 <constant>DELETE</constant>
83 </setHeader>
84 <setHeader headerName="CamelHttpUri">
85 <simple>{{clamp.config.policy.url}}/policyTypes/${body.getModelType()}/versions/1.0.0/policies/${body.getName()}
86 </simple>
87 </setHeader>
88 <setBody>
89 <constant>null</constant>
90 </setBody>
91 <!--<convertBodyTo type="org.onap.clamp.policy.microservice.MicroServicePolicy"/> -->
92 <log
93 loggingLevel="INFO"
94 message="Policy Endpoint for microservice: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
95 <toD
96 uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryException}" />
97
98 </route>
99 <route id="create-micro-service">
100 <from uri="direct:create-micro-service" />
101
102 <setHeader headerName="CamelHttpMethod">
103 <constant>POST</constant>
104 </setHeader>
105 <setHeader headerName="CamelHttpUri">
106 <simple>{{clamp.config.policy.url}}/policyTypes/${body.getModelType()}/versions/1.0.0/policies
107 </simple>
108 </setHeader>
109 <!--<convertBodyTo type="org.onap.clamp.policy.microservice.MicroServicePolicy"/> -->
110 <log
111 loggingLevel="INFO"
112 message="Policy Endpoint for microservice: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
113 <toD
114 uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryException}" />
115 </route>
Determe, Sebastien (sd378r)7c083742018-02-14 15:31:55 +0100116
117</routes>