diff options
author | sebdet <sebastien.determe@intl.att.com> | 2019-05-23 17:34:07 +0200 |
---|---|---|
committer | sebdet <sebastien.determe@intl.att.com> | 2019-06-05 11:05:35 +0200 |
commit | 09bc8450b2b0c4f60eb4a241efc548d13c5c9912 (patch) | |
tree | addd899e38e02946a6dfa3997b7a43264bd0276a /src/main/resources/clds/camel/rest/clamp-api-v2.xml | |
parent | c7b7368b08fa4e75919d6f7282dee526ccedf398 (diff) |
Rework the loop state
Rework the state loop so there is no bug in the loop state anymore, now
the components are scanned + upgrade to 4.0.4
Issue-ID: CLAMP-384
Change-Id: If7649238ee52864c84bfb9b6b8471d1738752e29
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.xml | 64 |
1 files changed, 15 insertions, 49 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 da856e947..101449492 100644 --- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -193,7 +193,7 @@ </route> </post> <put - uri="/v2/loop/deployLoop/{loopName}" + uri="/v2/loop/deploy/{loopName}" outType="org.onap.clamp.loop.Loop" produces="application/json"> <route> @@ -212,27 +212,8 @@ <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DCAE DEPLOY request','INFO',${exchangeProperty[loopObject]})" /> - <to uri="direct:get-status-from-policy" /> - <to uri="direct:get-status-from-dcae" /> - <log - loggingLevel="INFO" - message="Policy deployment status: ${exchangeProperty[policyStatus]}"></log> - <choice> - <when> - <simple> ${exchangeProperty[policyStatus]} == 'SUBMITTED' and - ${exchangeProperty[dcaeStatus]} == 'NOT_DEPLOYED' - </simple> - <to uri="direct:deploy-loop" /> - </when> - <otherwise> - <log - loggingLevel="INFO" - message="POLICY status ${exchangeProperty[policyStatus]}/DCAE status ${exchangeProperty[dcaeStatus]}, DCAE deployment will be started anyway" /> - <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('POLICY status ${exchangeProperty[policyStatus]}/DCAE status ${exchangeProperty[dcaeStatus]}, DCAE deployment will be started anyway','ERROR',${exchangeProperty[loopObject]})" /> - <to uri="direct:deploy-loop" /> - </otherwise> - </choice> + <to uri="direct:deploy-loop" /> + <log loggingLevel="INFO" message="DEPLOY request successfully executed for loop: ${header.loopName}" /> @@ -257,7 +238,7 @@ </route> </put> <put - uri="/v2/loop/undeployLoop/{loopName}" + uri="/v2/loop/undeploy/{loopName}" outType="org.onap.clamp.loop.Loop" produces="application/json"> <route> @@ -275,21 +256,8 @@ <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:get-status-from-dcae" /> - <choice> - <when> - <simple> ${exchangeProperty[dcaeStatus]} == 'DEPLOYED' or ${exchangeProperty[dcaeStatus]} == 'IN_ERROR' or ${exchangeProperty[dcaeStatus]} == 'PROCESSING' - </simple> <to uri="direct:undeploy-loop" /> - </when> - <otherwise> - <log - loggingLevel="INFO" - message="Loop is in state ${exchangeProperty[dcaeStatus]}, it can only be undeployed when in state DEPLOYED/IN_ERROR/PROCESSING" /> - <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('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}" /> @@ -524,6 +492,7 @@ <to uri="direct:load-loop" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request','INFO',${exchangeProperty[loopObject]})" /> + <to uri="direct:undeploy-loop" /> <to uri="direct:remove-all-policy-from-active-pdp-group" /> <split> <simple>${exchangeProperty[loopObject].getMicroServicePolicies()} @@ -609,20 +578,16 @@ <to uri="direct:load-loop" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request','INFO',${exchangeProperty[loopObject]})" /> - <setProperty propertyName="raiseHttpExceptionFlag"> - <simple resultType="java.lang.Boolean">false</simple> - </setProperty> - <to uri="direct:get-status-from-policy" /> - <to uri="direct:get-status-from-dcae" /> - <to - uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopStatus(${exchangeProperty[loopObject]},${exchangeProperty[policyStatus]}, ${exchangeProperty[dcaeStatus]})" /> - <log - loggingLevel="INFO" - message="Get Status request successfully executed. The new state is: ${body}" /> + <doTry> + <to uri="direct:update-policy-status-for-loop" /> + <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()" /> + </doTry> <doCatch> <exception>java.lang.Exception</exception> <handled> @@ -637,8 +602,9 @@ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" /> </doCatch> <doFinally> - <to - uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" /> + <setBody> + <simple>${exchangeProperty[loopObject]}</simple> + </setBody> </doFinally> </doTry> </route> |