Merge "Add template and tosca model entities and repositories"
[clamp.git] / src / main / resources / clds / camel / rest / clamp-api-v2.xml
index 1014494..a0a3eb1 100644 (file)
@@ -68,7 +68,7 @@
                                        <to
                                                uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
                                        <to
-                                               uri="bean:org.onap.clamp.loop.LoopController?method=getSVGRepresentation(${header.loopName})" />
+                                               uri="bean:org.onap.clamp.loop.LoopController?method=getSvgRepresentation(${header.loopName})" />
                                        <to
                                                uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
                                        <doCatch>
                                        <to uri="direct:load-loop" />
                                        <to
                                                uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DCAE DEPLOY request','INFO',${exchangeProperty[loopObject]})" />
-                                       
+
                                        <to uri="direct:deploy-loop" />
 
                                        <log
                                                        loggingLevel="ERROR"
                                                        message="DEPLOY request failed for loop: ${header.loopName}" />
                                                <to
-                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
+                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
+                                       </doCatch>
+                               </doTry>
+                       </route>
+               </put>
+               <put
+                       uri="/v2/loop/refreshOpPolicyJsonSchema/{loopName}"
+                       outType="org.onap.clamp.loop.Loop"
+                       produces="application/json">
+                       <route>
+                               <removeHeaders
+                                       pattern="*"
+                                       excludePattern="loopName" />
+                               <doTry>
+                                       <log
+                                               loggingLevel="INFO"
+                                               message="Refresh Operational Policy UI for loop: ${header.loopName}" />
+                                       <to
+                                               uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'REFRESH OP Policy UI request')" />
+                                       <to
+                                               uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+                                       <to uri="direct:load-loop" />
+                                       <to
+                                               uri="bean:org.onap.clamp.loop.LoopController?method=refreshOpPolicyJsonRepresentation(${header.loopName})" />
+                                       <log
+                                               loggingLevel="INFO"
+                                               message="REFRESH request successfully executed for loop: ${header.loopName}" />
+                                       <to
+                                               uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH request successfully executed','INFO',${exchangeProperty[loopObject]})" />
+                                       <to
+                                               uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+                                       <doCatch>
+                                               <exception>java.lang.Exception</exception>
+                                               <handled>
+                                                       <constant>false</constant>
+                                               </handled>
+                                               <to
+                                                       uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+                                               <log
+                                                       loggingLevel="ERROR"
+                                                       message="REFRESH request failed for loop: ${header.loopName}" />
+                                               <to
+                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
                                        </doCatch>
                                </doTry>
                        </route>
                                        <to uri="direct:load-loop" />
                                        <to
                                                uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DCAE UNDEPLOY request','INFO',${exchangeProperty[loopObject]})" />
-                                                       <to uri="direct:undeploy-loop" />
+                                       <to uri="direct:undeploy-loop" />
 
                                        <log
                                                loggingLevel="INFO"
                                                        loggingLevel="ERROR"
                                                        message="UNDEPLOY request failed for loop: ${header.loopName}" />
                                                <to
-                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
+                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
                                        </doCatch>
                                </doTry>
                        </route>
                                        <to uri="direct:load-loop" />
                                        <to
                                                uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request','INFO',${exchangeProperty[loopObject]})" />
-                                       
+
                                        <to uri="direct:remove-all-policy-from-active-pdp-group" />
                                        <log
                                                loggingLevel="INFO"
                                                        loggingLevel="ERROR"
                                                        message="STOP request failed for loop: $${header.loopName}" />
                                                <to
-                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
+                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
                                        </doCatch>
                                </doTry>
                        </route>
                                                        loggingLevel="ERROR"
                                                        message="RESTART request failed for loop: ${header.loopName}" />
                                                <to
-                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request failed, Error reported: ${exception}','INFO',${exchangeProperty[loopObject]})" />
+                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request failed, Error reported: ${exception} - Body: ${exception.responseBody}','INFO',${exchangeProperty[loopObject]})" />
                                        </doCatch>
                                </doTry>
                        </route>
                                                </split>
                                        </split>
 
+                                       <delay>
+                                               <constant>3000</constant>
+                                       </delay>
+
                                        <to uri="direct:add-all-to-active-pdp-group" />
 
                                        <log
                                                        loggingLevel="ERROR"
                                                        message="SUBMIT request failed for loop: ${header.loopName}" />
                                                <to
-                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
+                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
                                        </doCatch>
                                </doTry>
                        </route>
                                                        loggingLevel="ERROR"
                                                        message="DELETE request failed for loop: ${header.loopName}" />
                                                <to
-                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
+                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
                                        </doCatch>
                                </doTry>
                        </route>
                                                <to uri="direct:update-dcae-status-for-loop" />
                                                <to uri="direct:update-loop-state" />
 
-                                       <to
-                                               uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request successfully executed','INFO',${exchangeProperty[loopObject]})" />
-                                       <to
-                                               uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+                                               <to
+                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request successfully executed','INFO',${exchangeProperty[loopObject]})" />
+                                               <to
+                                                       uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
                                        </doTry>
                                        <doCatch>
                                                <exception>java.lang.Exception</exception>
                                                        loggingLevel="ERROR"
                                                        message="Get Status request failed for loop: ${header.loopName}" />
                                                <to
-                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
+                                                       uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
                                        </doCatch>
                                        <doFinally>
                                                <setBody>