aboutsummaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-07-12 18:32:49 +0000
committerGerrit Code Review <gerrit@onap.org>2021-07-12 18:32:49 +0000
commit26795001ac88eddb0ff18cf8e215d65f34c9d680 (patch)
tree336af451f7e098fe250777ba9e5c5fd05830f3eb /runtime
parent8c802e778db60e269e2e66c7a6609bf905f6ad79 (diff)
parent22595f692c26882a4775221a67d8e76fc6bafd09 (diff)
Merge "Add Camel Endpoint ControlLoop Instantiation"
Diffstat (limited to 'runtime')
-rw-r--r--runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml43
-rw-r--r--runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml25
2 files changed, 68 insertions, 0 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 b3c4edbe6..d560db660 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
@@ -1576,6 +1576,49 @@
</route>
</get>
+ <post uri="/v2/toscaControlLoop/postToscaInstantiation"
+ 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:post-tosca-instantiation"/>
+ <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="Create Tosca Instantiation Service FAILED"/>
+
+ <setHeader name="CamelHttpResponseCode">
+ <constant>500</constant>
+ </setHeader>
+ <setBody>
+ <simple>Create Tosca Instantiation Service FAILED</simple>
+ </setBody>
+ </doCatch>
+ </doTry>
+ </route>
+ </post>
+
<get uri="/v2/clampInformation" outType="org.onap.policy.clamp.clds.model.ClampInformation"
produces="application/json">
<route>
diff --git a/runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml b/runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml
index d2bf39b16..b7da4a743 100644
--- a/runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml
+++ b/runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml
@@ -79,4 +79,29 @@
</doFinally>
</doTry>
</route>
+ <route id="post-tosca-instantiation">
+ <from uri="direct:post-tosca-instantiation"/>
+ <doTry>
+ <log loggingLevel="INFO"
+ message="Create the tosca instantiation service"/>
+ <to
+ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Controlloop', 'Create the tosca instantiation service')"/>
+ <setHeader name="CamelHttpMethod">
+ <constant>POST</constant>
+ </setHeader>
+ <setHeader name="Content-Type">
+ <constant>application/json</constant>
+ </setHeader>
+ <log loggingLevel="INFO"
+ message="Endpoint to send Tosca Instantiation Service: {{clamp.config.controlloop.runtime.url}}/onap/controlloop/v2/instantiation"></log>
+ <toD
+ uri="{{clamp.config.controlloop.runtime.url}}/onap/controlloop/v2/instantiation?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.controlloop.runtime.userName}}&amp;authPassword={{clamp.config.controlloop.runtime.password}}&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
+ <convertBodyTo type="java.lang.String"/>
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag"/>
+ <to
+ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
+ </doFinally>
+ </doTry>
+ </route>
</routes>