aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/src/main/resources/clds/camel/rest
diff options
context:
space:
mode:
authorsaul.gill <saul.gill@est.tech>2021-06-17 16:28:22 +0100
committersaul.gill <saul.gill@est.tech>2021-06-17 16:28:30 +0100
commit0f1803780d61b8174bce4914044f5ee5d9a0ff42 (patch)
tree13d3136f6ea7b97e8b0ddf7cba180299f46a2d7a /runtime/src/main/resources/clds/camel/rest
parent17f5d3c97e47064407452122bc6cb801e43df5f9 (diff)
Added Camel Endpoint for Tosca Template Upload
Endpoint redirects a POST to runtime commissiong API Tosca Service Template is written to the database Issue-ID: POLICY-3222 Change-Id: I9ca6b0b3fdbef4bf9a182795112de5280ec7f9ff Signed-off-by: saul.gill <saul.gill@est.tech>
Diffstat (limited to 'runtime/src/main/resources/clds/camel/rest')
-rw-r--r--runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml46
1 files changed, 45 insertions, 1 deletions
diff --git a/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml
index 6a5da8710..5fd242282 100644
--- a/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -1461,7 +1461,8 @@
</route>
</post>
- <get uri="/v2/toscaControlLoop/getToscaTemplate" outType="java.lang.String" bindingMode="off" produces="application/json">
+ <get uri="/v2/toscaControlLoop/getToscaTemplate" outType="java.lang.String" bindingMode="off"
+ produces="application/json">
<route>
<removeHeaders pattern="*"
excludePattern="name|version"/>
@@ -1499,6 +1500,49 @@
</route>
</get>
+ <post uri="/v2/toscaControlLoop/commissionToscaTemplate"
+ type="java.lang.String"
+ consumes="plain/text"
+ outType="java.lang.String"
+ produces="application/json"
+ bindingMode="off">
+ <route>
+ <removeHeaders pattern="*"/>
+ <setProperty name="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setProperty>
+ <setHeader name="Content-Type">
+ <constant>application/json</constant>
+ </setHeader>
+ <doTry>
+ <to
+ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update the global properties')"/>
+ <to
+ uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')"/>
+ <to uri="direct:commission-service-template"/>
+ <to
+ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()"/>
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>true</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=errorLog()"/>
+ <log loggingLevel="ERROR"
+ message="Commissioning of Tosca Service Template FAILED"/>
+
+ <setHeader name="CamelHttpResponseCode">
+ <constant>500</constant>
+ </setHeader>
+ <setBody>
+ <simple>Commissioning Tosca Service Template FAILED</simple>
+ </setBody>
+ </doCatch>
+ </doTry>
+ </route>
+ </post>
+
<get uri="/v2/clampInformation" outType="org.onap.policy.clamp.clds.model.ClampInformation"
produces="application/json">
<route>