Rework the deploy/undeploy method
[clamp.git] / src / main / resources / clds / camel / rest / clamp-api-v2.xml
1 <rests xmlns="http://camel.apache.org/schema/spring" >
2     <rest >
3         <get uri="/v2/loop/getAllNames"
4             outType="java.lang.String[]"
5             produces="application/json">
6             <route>
7                 <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
8                 <to uri="bean:org.onap.clamp.loop.LoopController?method=getLoopNames()" />
9             </route>
10         </get>
11         <get uri="/v2/loop/{loopName}"
12             outType="org.onap.clamp.loop.Loop"
13             produces="application/json">
14             <route>
15                 <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
16                 <to uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
17             </route>
18         </get>
19         <get uri="/v2/loop/svgRepresentation/{loopName}"
20             outType="java.lang.String"
21             produces="application/xml">
22             <route>
23                 <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
24                 <to uri="bean:org.onap.clamp.loop.LoopController?method=getSVGRepresentation(${header.loopName})" />
25             </route>
26         </get>
27
28         <post uri="/v2/loop/updateGlobalProperties/{loopName}"
29             type="com.google.gson.JsonObject"
30             consumes="application/json"
31             outType="org.onap.clamp.loop.Loop"
32             produces="application/json">
33             <route>
34                 <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
35                 <to uri="bean:org.onap.clamp.loop.LoopController?method=updateGlobalPropertiesJson(${header.loopName},${body})" />
36             </route>
37         </post>
38         <post uri="/v2/loop/updateOperationalPolicies/{loopName}"
39             type="com.google.gson.JsonArray"
40             consumes="application/json"
41             outType="org.onap.clamp.loop.Loop"
42             produces="application/json">
43             <route>
44                 <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
45                 <to uri="bean:org.onap.clamp.loop.LoopController?method=updateOperationalPolicies(${header.loopName},${body})" />
46             </route>
47         </post>
48         <post uri="/v2/loop/updateMicroservicePolicy/{loopName}"
49             type="org.onap.clamp.policy.microservice.MicroServicePolicy"
50             consumes="application/json"
51             outType="org.onap.clamp.policy.microservice.MicroServicePolicy"
52             produces="application/json">
53             <route>
54                 <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
55                 <to uri="bean:org.onap.clamp.loop.LoopController?method=updateMicroservicePolicy(${header.loopName},${body})" />
56             </route>
57         </post>
58         <put uri="/v2/loop/deployLoop/{loopName}"
59             outType="org.onap.clamp.loop.Loop"
60             produces="application/json">
61             <route>
62                 <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
63                 <to uri="bean:org.onap.clamp.operation.LoopOperation?method=deployLoop(*,${header.loopName})" />
64             </route>
65         </put>
66         <put uri="/v2/loop/undeployLoop/{loopName}"
67             outType="org.onap.clamp.loop.Loop"
68             produces="application/json">
69             <route>
70                 <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
71                 <to uri="bean:org.onap.clamp.operation.LoopOperation?method=unDeployLoop(${header.loopName})" />
72             </route>
73         </put>
74     </rest>
75 </rests>
76