diff options
author | Jim Hahn <jrh3@att.com> | 2021-07-19 13:23:34 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-07-19 13:23:34 +0000 |
commit | 903c037be7570635ae7db6beacbeeb2a9a57b6d4 (patch) | |
tree | e2df5957553e49ad2c471efd25a1cf3407418963 | |
parent | 87d96a043499a636053d12b3b9dbb73b830c760e (diff) | |
parent | 944b7eb22141caa54043668adb645f1393cf8d18 (diff) |
Merge "Add Camel Endpoint Change State CL Instantiation"
-rw-r--r-- | runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml | 43 | ||||
-rw-r--r-- | runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml | 25 |
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 8a7523c2b..4b07f6458 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 @@ -1653,6 +1653,49 @@ </route> </post> + <put uri="/v2/toscaControlLoop/putToscaInstantiationStateChange" + 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:put-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="Tosca Instantiation State Change Service FAILED"/> + + <setHeader name="CamelHttpResponseCode"> + <constant>500</constant> + </setHeader> + <setBody> + <simple>Tosca Instantiation State Change Service FAILED</simple> + </setBody> + </doCatch> + </doTry> + </route> + </put> + <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 a888d6bf0..6ee2572b3 100644 --- a/runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml +++ b/runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml @@ -104,6 +104,31 @@ </doFinally> </doTry> </route> + <route id="put-tosca-instantiation"> + <from uri="direct:put-tosca-instantiation"/> + <doTry> + <log loggingLevel="INFO" + message="Change the tosca instantiation state service"/> + <to + uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Controlloop', 'Change the tosca instantiation state service')"/> + <setHeader name="CamelHttpMethod"> + <constant>PUT</constant> + </setHeader> + <setHeader name="Content-Type"> + <constant>application/json</constant> + </setHeader> + <log loggingLevel="INFO" + message="Endpoint to send Tosca Instantiation state change Service: {{clamp.config.controlloop.runtime.url}}/onap/controlloop/v2/instantiation/command"></log> + <toD + uri="{{clamp.config.controlloop.runtime.url}}/onap/controlloop/v2/instantiation/command?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.controlloop.runtime.userName}}&authPassword={{clamp.config.controlloop.runtime.password}}&authenticationPreemptive=true&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> <route id="get-json-schema"> <from uri="direct:get-json-schema"/> <doTry> |