blob: a823c09da16b4172f40e146f9d833a3ceaa3842a [file] [log] [blame]
sebdetdfa86ca2019-04-05 15:15:31 +02001<rests xmlns="http://camel.apache.org/schema/spring">
2 <rest>
3 <get
4 uri="/v2/loop/getAllNames"
5 outType="java.lang.String[]"
6 produces="application/json">
7 <route>
8 <to
9 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
10 <to
11 uri="bean:org.onap.clamp.loop.LoopController?method=getLoopNames()" />
12 </route>
13 </get>
14 <get
15 uri="/v2/loop/{loopName}"
16 outType="org.onap.clamp.loop.Loop"
17 produces="application/json">
18 <route>
19 <to
20 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
21 <to
22 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
23 </route>
24 </get>
25 <get
26 uri="/v2/loop/svgRepresentation/{loopName}"
27 outType="java.lang.String"
28 produces="application/xml">
29 <route>
30 <to
31 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
32 <to
33 uri="bean:org.onap.clamp.loop.LoopController?method=getSVGRepresentation(${header.loopName})" />
34 </route>
35 </get>
michal.banka89695a32019-03-12 13:01:26 +010036
sebdetdfa86ca2019-04-05 15:15:31 +020037 <post
38 uri="/v2/loop/updateGlobalProperties/{loopName}"
39 type="com.google.gson.JsonObject"
40 consumes="application/json"
41 outType="org.onap.clamp.loop.Loop"
42 produces="application/json">
43 <route>
44 <to
45 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
sebdet667cb722019-04-11 02:07:44 +020046 <setHeader headerName="GlobalPropertiesJson">
47 <simple>${body}</simple>
48 </setHeader>
49 <to uri="direct:load-loop" />
sebdetdfa86ca2019-04-05 15:15:31 +020050 <to
sebdet667cb722019-04-11 02:07:44 +020051 uri="bean:org.onap.clamp.loop.LoopController?method=updateGlobalPropertiesJson(${header.loopName},${header.GlobalPropertiesJson})" />
52 <to
53 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Global Properties UPDATED','INFO',${header.LoopObject})" />
sebdetdfa86ca2019-04-05 15:15:31 +020054 </route>
55 </post>
56 <post
57 uri="/v2/loop/updateOperationalPolicies/{loopName}"
58 type="com.google.gson.JsonArray"
59 consumes="application/json"
60 outType="org.onap.clamp.loop.Loop"
61 produces="application/json">
62 <route>
63 <to
64 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
sebdet667cb722019-04-11 02:07:44 +020065 <setHeader headerName="OperationalPoliciesArray">
66 <simple>${body}</simple>
67 </setHeader>
68 <to uri="direct:load-loop" />
sebdetdfa86ca2019-04-05 15:15:31 +020069 <to
sebdet667cb722019-04-11 02:07:44 +020070 uri="bean:org.onap.clamp.loop.LoopController?method=updateOperationalPolicies(${header.loopName},${header.OperationalPoliciesArray})" />
71 <to
72 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational and Guard policies UPDATED','INFO',${header.LoopObject})" />
sebdetdfa86ca2019-04-05 15:15:31 +020073 </route>
74 </post>
75 <post
76 uri="/v2/loop/updateMicroservicePolicy/{loopName}"
77 type="org.onap.clamp.policy.microservice.MicroServicePolicy"
78 consumes="application/json"
79 outType="org.onap.clamp.policy.microservice.MicroServicePolicy"
80 produces="application/json">
81 <route>
82 <to
83 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
sebdet667cb722019-04-11 02:07:44 +020084 <setHeader headerName="MicroServicePolicyObject">
85 <simple>${body}</simple>
86 </setHeader>
87
88 <to uri="direct:load-loop" />
sebdetdfa86ca2019-04-05 15:15:31 +020089 <to
sebdet667cb722019-04-11 02:07:44 +020090 uri="bean:org.onap.clamp.loop.LoopController?method=updateMicroservicePolicy(${header.loopName},${header.MicroServicePolicyObject})" />
91 <to
92 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Micro Service policies UPDATED','INFO',${header.LoopObject})" />
sebdetdfa86ca2019-04-05 15:15:31 +020093 </route>
94 </post>
95 <put
96 uri="/v2/loop/deployLoop/{loopName}"
97 outType="org.onap.clamp.loop.Loop"
98 produces="application/json">
99 <route>
100 <to
101 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
102 <to
103 uri="bean:org.onap.clamp.operation.LoopOperation?method=deployLoop(*,${header.loopName})" />
104 </route>
105 </put>
106 <put
107 uri="/v2/loop/undeployLoop/{loopName}"
108 outType="org.onap.clamp.loop.Loop"
109 produces="application/json">
110 <route>
111 <to
112 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
113 <to
114 uri="bean:org.onap.clamp.operation.LoopOperation?method=unDeployLoop(${header.loopName})" />
115 </route>
116 </put>
sebdet667cb722019-04-11 02:07:44 +0200117 <put
sebdet1efe60f2019-04-11 17:58:36 +0200118 uri="/v2/loop/stop/{loopName}"
119 outType="org.onap.clamp.loop.Loop"
120 produces="application/json">
121 <route>
122 <log
123 loggingLevel="INFO"
124 message="Receive STOP request for loop: ${header.loopName}" />
125 </route>
126 <to
127 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
128 <to uri="direct:load-loop" />
129 <to uri="direct:remove-all-policy-from-active-pdp-group" />
130 <log
131 loggingLevel="INFO"
132 message="STOP request successfully executed for loop: ${body}" />
133 <to
134 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${header.LoopObject})" />
135 <to
136 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
137 </put>
138 <put
139 uri="/v2/loop/start/{loopName}"
140 outType="org.onap.clamp.loop.Loop"
141 produces="application/json">
142 <route>
143 <log
144 loggingLevel="INFO"
145 message="Receive START request for loop: ${header.loopName}" />
146 </route>
147 <to
148 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
149 <to uri="direct:load-loop" />
150 <to uri="direct:add-all-to-active-pdp-group" />
151 <log
152 loggingLevel="INFO"
153 message="START request successfully executed for loop: ${body}" />
154 <to
155 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request successfully executed','INFO',${header.LoopObject})" />
156 <to
157 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
158 </put>
159 <put
sebdet667cb722019-04-11 02:07:44 +0200160 uri="/v2/loop/submit/{loopName}"
161 outType="org.onap.clamp.loop.Loop"
162 produces="application/json">
sebdetdfa86ca2019-04-05 15:15:31 +0200163 <route>
sebdetcd64cc42019-04-10 14:07:35 +0200164 <log
165 loggingLevel="INFO"
166 message="Receive SUBMIT request for loop: ${header.loopName}" />
167 <to
168 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
sebdet919ef9d2019-04-08 18:32:26 +0200169 <to uri="direct:load-loop" />
sebdetea775862019-04-09 13:08:10 +0200170 <to
171 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive SUBMIT request','INFO',${header.LoopObject})" />
sebdet667cb722019-04-11 02:07:44 +0200172 <setHeader headerName="RaiseHttpExceptionFlag">
173 <simple resultType="java.lang.Boolean">false</simple>
174 </setHeader>
175 <to uri="direct:remove-all-policy-from-active-pdp-group" />
sebdet919ef9d2019-04-08 18:32:26 +0200176 <log
177 loggingLevel="INFO"
178 message="Processing all MICRO-SERVICES policies defined in loop ${header.LoopObject.getName()}" />
179 <split>
sebdetdfa86ca2019-04-05 15:15:31 +0200180 <simple>${header.LoopObject.getMicroServicePolicies()}
181 </simple>
sebdet919ef9d2019-04-08 18:32:26 +0200182 <setHeader headerName="microServicePolicy">
183 <simple>${body}</simple>
184 </setHeader>
185 <log
186 loggingLevel="INFO"
187 message="Processing Micro Service Policy: ${header.microServicePolicy.getName()}" />
sebdetcd64cc42019-04-10 14:07:35 +0200188 <setHeader headerName="RaiseHttpExceptionFlag">
sebdetdfa86ca2019-04-05 15:15:31 +0200189 <simple resultType="java.lang.Boolean">false</simple>
190 </setHeader>
sebdet919ef9d2019-04-08 18:32:26 +0200191 <to uri="direct:delete-micro-service-policy" />
192
sebdet919ef9d2019-04-08 18:32:26 +0200193 <to uri="direct:create-micro-service-policy" />
194 </split>
195
196 <log
197 loggingLevel="INFO"
198 message="Processing all OPERATIONAL policies defined in loop ${header.LoopObject.getName()}" />
199 <split>
200 <simple>${header.LoopObject.getOperationalPolicies()}
201 </simple>
202 <setHeader headerName="operationalPolicy">
203 <simple>${body}</simple>
204 </setHeader>
205 <log
206 loggingLevel="INFO"
207 message="Processing Operational Policy: ${header.operationalPolicy.getName()}" />
sebdetcd64cc42019-04-10 14:07:35 +0200208 <setHeader headerName="RaiseHttpExceptionFlag">
sebdet919ef9d2019-04-08 18:32:26 +0200209 <simple resultType="java.lang.Boolean">false</simple>
210 </setHeader>
211 <to uri="direct:delete-operational-policy" />
212
sebdet919ef9d2019-04-08 18:32:26 +0200213 <to uri="direct:create-operational-policy" />
214 <log
215 loggingLevel="INFO"
216 message="Processing all GUARD policies defined in loop ${header.LoopObject.getName()}" />
217 <split>
218 <simple>${header.operationalPolicy.createGuardPolicyPayloads().entrySet()}
219 </simple>
220 <setHeader headerName="guardPolicy">
221 <simple>${body}</simple>
222 </setHeader>
223 <log
224 loggingLevel="INFO"
225 message="Processing Guard Policy: ${header.guardPolicy.getKey()}" />
226
sebdetcd64cc42019-04-10 14:07:35 +0200227 <setHeader headerName="RaiseHttpExceptionFlag">
sebdet919ef9d2019-04-08 18:32:26 +0200228 <simple resultType="java.lang.Boolean">false</simple>
229 </setHeader>
230 <to uri="direct:delete-guard-policy" />
231
sebdet919ef9d2019-04-08 18:32:26 +0200232 <to uri="direct:create-guard-policy" />
233 </split>
sebdetdfa86ca2019-04-05 15:15:31 +0200234 </split>
sebdet667cb722019-04-11 02:07:44 +0200235 <to uri="direct:add-all-to-active-pdp-group" />
236
sebdeteb71d702019-04-09 18:10:32 +0200237 <log
238 loggingLevel="INFO"
239 message="SUBMIT request successfully executed for loop: ${body}" />
240 <to
241 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${header.LoopObject})" />
sebdet667cb722019-04-11 02:07:44 +0200242 <to
243 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
sebdetdfa86ca2019-04-05 15:15:31 +0200244 </route>
245 </put>
sebdet919ef9d2019-04-08 18:32:26 +0200246 <put uri="/v2/loop/delete/{loopName}">
sebdetdfa86ca2019-04-05 15:15:31 +0200247 <route>
sebdetcd64cc42019-04-10 14:07:35 +0200248 <log
249 loggingLevel="INFO"
250 message="Receive DELETE request for loop: ${header.loopName}" />
sebdetdfa86ca2019-04-05 15:15:31 +0200251 <to
252 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
sebdetcd64cc42019-04-10 14:07:35 +0200253 <to uri="direct:load-loop" />
sebdetdfa86ca2019-04-05 15:15:31 +0200254 <to
sebdetcd64cc42019-04-10 14:07:35 +0200255 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive DELETE request','INFO',${header.LoopObject})" />
sebdet667cb722019-04-11 02:07:44 +0200256 <to uri="direct:remove-all-policy-from-active-pdp-group" />
sebdetcd64cc42019-04-10 14:07:35 +0200257 <split>
258 <simple>${header.LoopObject.getMicroServicePolicies()}
259 </simple>
260 <setHeader headerName="microServicePolicy">
261 <simple>${body}</simple>
262 </setHeader>
263 <log
264 loggingLevel="INFO"
265 message="Processing Micro Service Policy: ${header.microServicePolicy.getName()}" />
sebdet667cb722019-04-11 02:07:44 +0200266
sebdetcd64cc42019-04-10 14:07:35 +0200267 <to uri="direct:delete-micro-service-policy" />
268 </split>
269
270 <log
271 loggingLevel="INFO"
272 message="Processing all OPERATIONAL policies defined in loop ${header.LoopObject.getName()}" />
273 <split>
274 <simple>${header.LoopObject.getOperationalPolicies()}
275 </simple>
276 <setHeader headerName="operationalPolicy">
277 <simple>${body}</simple>
278 </setHeader>
279 <log
280 loggingLevel="INFO"
281 message="Processing Operational Policy: ${header.operationalPolicy.getName()}" />
sebdet667cb722019-04-11 02:07:44 +0200282
sebdetcd64cc42019-04-10 14:07:35 +0200283 <to uri="direct:delete-operational-policy" />
284 <log
285 loggingLevel="INFO"
286 message="Processing all GUARD policies defined in loop ${header.LoopObject.getName()}" />
287 <split>
288 <simple>${header.operationalPolicy.createGuardPolicyPayloads().entrySet()}
289 </simple>
290 <setHeader headerName="guardPolicy">
291 <simple>${body}</simple>
292 </setHeader>
293 <log
294 loggingLevel="INFO"
295 message="Processing Guard Policy: ${header.guardPolicy.getKey()}" />
296
sebdetcd64cc42019-04-10 14:07:35 +0200297 <to uri="direct:delete-guard-policy" />
298 </split>
299 </split>
sebdet667cb722019-04-11 02:07:44 +0200300 <to
301 uri="bean:org.onap.clamp.loop.log.LoopService?method=deleteLoop(${header.loopName})" />
sebdetcd64cc42019-04-10 14:07:35 +0200302 <log
303 loggingLevel="INFO"
304 message="DELETE request successfully executed for loop: ${body}" />
sebdetdfa86ca2019-04-05 15:15:31 +0200305 <to
sebdetcd64cc42019-04-10 14:07:35 +0200306 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request successfully executed','INFO',${header.LoopObject})" />
sebdetdfa86ca2019-04-05 15:15:31 +0200307 </route>
308 </put>
309 </rest>
Krysiak Adam5f14c7a2019-03-01 15:32:19 +0100310</rests>
311