summaryrefslogtreecommitdiffstats
path: root/src/main/resources/clds/camel/rest/clamp-api-v2.xml
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2019-05-08 15:36:55 +0200
committersebdet <sebastien.determe@intl.att.com>2019-05-08 15:36:55 +0200
commitb328b37f8e6b27cc4eed183bb0096d6603517e20 (patch)
tree01d4e42e6e0a0a3524f4d36ee7f694a084dd2dea /src/main/resources/clds/camel/rest/clamp-api-v2.xml
parentb0f7e5bf406a393abc6cfb9fc6cf1003b6e6ef10 (diff)
Fix flows and error catching
Fix flows, remove getLoop at the end and add better error catching in camel flows Issue-ID: CLAMP-369 Change-Id: I473d63d9189daf69e1e4e6d025f06ac586a9f2ab Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'src/main/resources/clds/camel/rest/clamp-api-v2.xml')
-rw-r--r--src/main/resources/clds/camel/rest/clamp-api-v2.xml57
1 files changed, 28 insertions, 29 deletions
diff --git a/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
index 4d3c6b389..1883145d7 100644
--- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -202,25 +202,21 @@
excludePattern="loopName" />
<doTry>
<to
- uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Deploy the closed loop')" />
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DEPLOY the closed loop')" />
<to
uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
- <to
- uri="direct:load-loop" />
- <to
- uri="direct:get-status-from-policy" />
- <to
- uri="direct:get-status-from-dcae" />
+ <to uri="direct:load-loop" />
+ <to uri="direct:get-status-from-policy" />
+ <to uri="direct:get-status-from-dcae" />
<log
loggingLevel="INFO"
- message="policy status0000: ${exchangeProperty[policyStatus]}"></log>
+ message="Policy deployment status: ${exchangeProperty[policyStatus]}"></log>
<choice>
<when>
<simple> ${exchangeProperty[policyStatus]} == 'SUBMITTED' and
${exchangeProperty[dcaeStatus]} == 'NOT_DEPLOYED'
</simple>
- <to
- uri="direct:deploy-closedloop" />
+ <to uri="direct:deploy-closedloop" />
</when>
<otherwise>
<log
@@ -230,6 +226,11 @@
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Closed Loop is in state ${exchangeProperty[policyStatus]}, it can only be deployed when in state SUBMIT','ERROR',${exchangeProperty[loopObject]})" />
</otherwise>
</choice>
+ <log
+ loggingLevel="INFO"
+ message="DEPLOY request successfully executed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
<doCatch>
@@ -241,9 +242,9 @@
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
<log
loggingLevel="ERROR"
- message="Deploy request failed for loop: ${header.loopName}" />
+ message="DEPLOY request failed for loop: ${header.loopName}" />
<to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Deploy request failed','ERROR',${exchangeProperty[loopObject]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
</doCatch>
</doTry>
</route>
@@ -261,16 +262,13 @@
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Undeploy the closed loop')" />
<to
uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
- <to
- uri="direct:load-loop" />
- <to
- uri="direct:get-status-from-dcae" />
+ <to uri="direct:load-loop" />
+ <to uri="direct:get-status-from-dcae" />
<choice>
<when>
<simple> ${exchangeProperty[dcaeStatus]} == 'DEPLOYED'
</simple>
- <to
- uri="direct:undeploy-closedloop" />
+ <to uri="direct:undeploy-closedloop" />
</when>
<otherwise>
<log
@@ -280,6 +278,11 @@
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Closed Loop is in state ${exchangeProperty[dcaeStatus]}, it can only be deployed when in state DEPLOYED','ERROR',${exchangeProperty[loopObject]})" />
</otherwise>
</choice>
+ <log
+ loggingLevel="INFO"
+ message="UNDEPLOY request successfully executed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
<doCatch>
@@ -291,9 +294,9 @@
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
<log
loggingLevel="ERROR"
- message="Undeploy request failed for loop: $${header.loopName}" />
+ message="UNDEPLOY request failed for loop: ${header.loopName}" />
<to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Undeploy request failed','ERROR',${exchangeProperty[loopObject]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
</doCatch>
</doTry>
</route>
@@ -318,12 +321,10 @@
<to uri="direct:remove-all-policy-from-active-pdp-group" />
<log
loggingLevel="INFO"
- message="STOP request successfully executed for loop: ${body}" />
+ message="STOP request successfully executed for loop: ${header.loopName}" />
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${exchangeProperty[loopObject]})" />
<to
- uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
- <to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
<doCatch>
<exception>java.lang.Exception</exception>
@@ -367,8 +368,6 @@
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request successfully executed','INFO',${exchangeProperty[loopObject]})" />
<to
- uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
- <to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
<doCatch>
<exception>java.lang.Exception</exception>
@@ -475,8 +474,6 @@
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" />
<to
- uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
- <to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
<doCatch>
<exception>java.lang.Exception</exception>
@@ -581,7 +578,9 @@
outType="org.onap.clamp.loop.Loop"
produces="application/json">
<route>
- <removeHeaders pattern="*" excludePattern="loopName"/>
+ <removeHeaders
+ pattern="*"
+ excludePattern="loopName" />
<doTry>
<log
loggingLevel="INFO"
@@ -620,7 +619,7 @@
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',${exchangeProperty[loopObject]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
</doCatch>
</doTry>
</route>