blob: 76f45881ab32edfed97d6a47f85e901333bab634 [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')" />
46 <to
47 uri="bean:org.onap.clamp.loop.LoopController?method=updateGlobalPropertiesJson(${header.loopName},${body})" />
48 </route>
49 </post>
50 <post
51 uri="/v2/loop/updateOperationalPolicies/{loopName}"
52 type="com.google.gson.JsonArray"
53 consumes="application/json"
54 outType="org.onap.clamp.loop.Loop"
55 produces="application/json">
56 <route>
57 <to
58 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
59 <to
60 uri="bean:org.onap.clamp.loop.LoopController?method=updateOperationalPolicies(${header.loopName},${body})" />
61 </route>
62 </post>
63 <post
64 uri="/v2/loop/updateMicroservicePolicy/{loopName}"
65 type="org.onap.clamp.policy.microservice.MicroServicePolicy"
66 consumes="application/json"
67 outType="org.onap.clamp.policy.microservice.MicroServicePolicy"
68 produces="application/json">
69 <route>
70 <to
71 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
72 <to
73 uri="bean:org.onap.clamp.loop.LoopController?method=updateMicroservicePolicy(${header.loopName},${body})" />
74 </route>
75 </post>
76 <put
77 uri="/v2/loop/deployLoop/{loopName}"
78 outType="org.onap.clamp.loop.Loop"
79 produces="application/json">
80 <route>
81 <to
82 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
83 <to
84 uri="bean:org.onap.clamp.operation.LoopOperation?method=deployLoop(*,${header.loopName})" />
85 </route>
86 </put>
87 <put
88 uri="/v2/loop/undeployLoop/{loopName}"
89 outType="org.onap.clamp.loop.Loop"
90 produces="application/json">
91 <route>
92 <to
93 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
94 <to
95 uri="bean:org.onap.clamp.operation.LoopOperation?method=unDeployLoop(${header.loopName})" />
96 </route>
97 </put>
98 <put uri="/v2/loop/submit/{loopName}">
99 <route>
100 <setBody>
101 <simple>${header.loopName}</simple>
102 </setBody>
103 <log
104 loggingLevel="INFO"
sebdet919ef9d2019-04-08 18:32:26 +0200105 message="Receive SUBMIT request for loop: ${body}" />
sebdetdfa86ca2019-04-05 15:15:31 +0200106 <to
107 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
sebdet919ef9d2019-04-08 18:32:26 +0200108 <to uri="direct:load-loop" />
109 <log
110 loggingLevel="INFO"
111 message="Processing all MICRO-SERVICES policies defined in loop ${header.LoopObject.getName()}" />
112 <split>
sebdetdfa86ca2019-04-05 15:15:31 +0200113 <simple>${header.LoopObject.getMicroServicePolicies()}
114 </simple>
sebdet919ef9d2019-04-08 18:32:26 +0200115 <setHeader headerName="microServicePolicy">
116 <simple>${body}</simple>
117 </setHeader>
118 <log
119 loggingLevel="INFO"
120 message="Processing Micro Service Policy: ${header.microServicePolicy.getName()}" />
121 <setHeader headerName="HttpQueryExceptionFlag">
sebdetdfa86ca2019-04-05 15:15:31 +0200122 <simple resultType="java.lang.Boolean">false</simple>
123 </setHeader>
sebdet919ef9d2019-04-08 18:32:26 +0200124 <to uri="direct:delete-micro-service-policy" />
125
126 <setHeader headerName="HttpQueryExceptionFlag">
sebdetdfa86ca2019-04-05 15:15:31 +0200127 <simple resultType="java.lang.Boolean">true</simple>
128 </setHeader>
sebdet919ef9d2019-04-08 18:32:26 +0200129 <to uri="direct:create-micro-service-policy" />
130 </split>
131
132 <log
133 loggingLevel="INFO"
134 message="Processing all OPERATIONAL policies defined in loop ${header.LoopObject.getName()}" />
135 <split>
136 <simple>${header.LoopObject.getOperationalPolicies()}
137 </simple>
138 <setHeader headerName="operationalPolicy">
139 <simple>${body}</simple>
140 </setHeader>
141 <log
142 loggingLevel="INFO"
143 message="Processing Operational Policy: ${header.operationalPolicy.getName()}" />
144 <setHeader headerName="HttpQueryExceptionFlag">
145 <simple resultType="java.lang.Boolean">false</simple>
146 </setHeader>
147 <to uri="direct:delete-operational-policy" />
148
149 <setHeader headerName="HttpQueryExceptionFlag">
150 <simple resultType="java.lang.Boolean">true</simple>
151 </setHeader>
152 <to uri="direct:create-operational-policy" />
153 <log
154 loggingLevel="INFO"
155 message="Processing all GUARD policies defined in loop ${header.LoopObject.getName()}" />
156 <split>
157 <simple>${header.operationalPolicy.createGuardPolicyPayloads().entrySet()}
158 </simple>
159 <setHeader headerName="guardPolicy">
160 <simple>${body}</simple>
161 </setHeader>
162 <log
163 loggingLevel="INFO"
164 message="Processing Guard Policy: ${header.guardPolicy.getKey()}" />
165
166 <setHeader headerName="HttpQueryExceptionFlag">
167 <simple resultType="java.lang.Boolean">false</simple>
168 </setHeader>
169 <to uri="direct:delete-guard-policy" />
170
171 <setHeader headerName="HttpQueryExceptionFlag">
172 <simple resultType="java.lang.Boolean">true</simple>
173 </setHeader>
174 <to uri="direct:create-guard-policy" />
175 </split>
sebdetdfa86ca2019-04-05 15:15:31 +0200176
177 </split>
178 </route>
179 </put>
sebdet919ef9d2019-04-08 18:32:26 +0200180 <put uri="/v2/loop/delete/{loopName}">
sebdetdfa86ca2019-04-05 15:15:31 +0200181 <route>
182 <to
183 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
184 <to
185 uri="bean:org.onap.clamp.operation.LoopOperation?method=deleteMsPolicies(${header.loopName})" />
186 <to
187 uri="bean:org.onap.clamp.operation.LoopOperation?method=deleteOpPolicy(${header.loopName})" />
188 <to
189 uri="bean:org.onap.clamp.operation.LoopOperation?method=deleteGuardPolicy(${header.loopName})" />
190 </route>
191 </put>
192 </rest>
Krysiak Adam5f14c7a2019-03-01 15:32:19 +0100193</rests>
194