diff options
author | xg353y <xg353y@intl.att.com> | 2019-04-26 13:26:25 +0200 |
---|---|---|
committer | xg353y <xg353y@intl.att.com> | 2019-04-30 15:17:51 +0200 |
commit | 39d82def1e54d6584f41ab9f94d30c2057858c32 (patch) | |
tree | bdf6ab8f61b2090a0fc0b05f8116115996175fcd /src/main/resources/clds/camel/routes | |
parent | 2d526d7d2113a87ce7b6fbd47bca6f1536822da5 (diff) |
Fix the get loop state logic
Fix the logic to get the loop state and update the CL deploy/undeploy
flow accordingly
Issue-ID: CLAMP-362
Change-Id: I34f83bd241b1029417453908bf932c0b69f9f5b2
Signed-off-by: xg353y <xg353y@intl.att.com>
Diffstat (limited to 'src/main/resources/clds/camel/routes')
-rw-r--r-- | src/main/resources/clds/camel/routes/flexible-flow.xml | 217 |
1 files changed, 217 insertions, 0 deletions
diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml index 75341de93..681380085 100644 --- a/src/main/resources/clds/camel/routes/flexible-flow.xml +++ b/src/main/resources/clds/camel/routes/flexible-flow.xml @@ -490,7 +490,224 @@ </doFinally> </doTry> </route> + <route id="deploy-closedloop"> + <from uri="direct:deploy-closedloop" /> + <doTry> + <log + loggingLevel="INFO" + message="Deploy the closed loop: ${exchangeProperty[loopObject].getName()}" /> + <to + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Deploy closed loop')" /> + <simple>${exchangeProperty[loopObject].getOperationalPolicies()} + </simple> + <setProperty propertyName="operationalPolicy"> + <simple>${body}</simple> + </setProperty> + <setBody> + <method ref="org.onap.clamp.loop.LoopOperation" + method="getDeployPayload(${exchangeProperty[loopObject]})" /> + </setBody> + <setProperty propertyName="deploymentId"> + <method ref="org.onap.clamp.loop.LoopOperation" + method="getDeploymentId(${exchangeProperty[loopObject]})" /> + </setProperty> + <setHeader headerName="CamelHttpMethod"> + <constant>PUT</constant> + </setHeader> + <setHeader headerName="Content-Type"> + <constant>application/json</constant> + </setHeader> + <setHeader headerName="X-ONAP-RequestID"> + <simple>${exchangeProperty[X-ONAP-RequestID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-InvocationID"> + <simple>${exchangeProperty[X-ONAP-InvocationID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-PartnerName"> + <simple>${exchangeProperty[X-ONAP-PartnerName]} + </simple> + </setHeader> + <log + loggingLevel="INFO" + message="Endpoint to deploy closed loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}"></log> + <toD + uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[RaiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}" /> + <to + uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopInfo(*,${exchangeProperty[loopObject]},${exchangeProperty[deploymentId]})" /> + <doFinally> + <to uri="direct:reset-raise-http-exception-flag" /> + <to + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> + <setProperty propertyName="logMessage"> + <simple>Deploy closed loop status</simple> + </setProperty> + <to uri="direct:dump-loop-log-http-response" /> + </doFinally> + </doTry> + </route> + <route id="undeploy-closedloop"> + <from uri="direct:undeploy-closedloop" /> + <doTry> + <log + loggingLevel="INFO" + message="UNdeploy the closed loop: ${exchangeProperty[loopObject].getName()} : ${exchangeProperty[loopObject].getDcaeDeploymentId()}" /> + <to + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Undeploy closed loop')" /> + + <setBody> + <simple>{\"serviceTypeId\": \"${exchangeProperty[loopObject].getDcaeBlueprintId()}\"} + </simple> + </setBody> + <setHeader headerName="CamelHttpMethod"> + <constant>DELETE</constant> + </setHeader> + <setHeader headerName="Content-Type"> + <constant>application/json</constant> + </setHeader> + <setHeader headerName="X-ONAP-RequestID"> + <simple>${exchangeProperty[X-ONAP-RequestID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-InvocationID"> + <simple>${exchangeProperty[X-ONAP-InvocationID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-PartnerName"> + <simple>${exchangeProperty[X-ONAP-PartnerName]} + </simple> + </setHeader> + <log + loggingLevel="INFO" + message="Endpoint to undeploy closed loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}"></log> + <toD + uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[RaiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}" /> + <to + uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopInfo(*,${exchangeProperty[loopObject]},null)" /> + <doFinally> + <to uri="direct:reset-raise-http-exception-flag" /> + <to + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> + <setProperty propertyName="logMessage"> + <simple>Undeploy closed loop status</simple> + </setProperty> + <to uri="direct:dump-loop-log-http-response" /> + </doFinally> + </doTry> + </route> + <route id="get-status-from-policy"> + <from uri="direct:get-status-from-policy" /> + <doTry> + <log + loggingLevel="INFO" + message="Query Closed Loop status from policy DPD: ${exchangeProperty[loopObject].getName()}" /> + <to + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Query operational policies to PDP group')" /> + <setBody> + <constant>null</constant> + </setBody> + <setHeader headerName="CamelHttpMethod"> + <constant>GET</constant> + </setHeader> + <setHeader headerName="X-ONAP-RequestID"> + <simple>${exchangeProperty[X-ONAP-RequestID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-InvocationID"> + <simple>${exchangeProperty[X-ONAP-InvocationID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-PartnerName"> + <simple>${exchangeProperty[X-ONAP-PartnerName]} + </simple> + </setHeader> + <log + loggingLevel="INFO" + message="Endpoint to query from Policy DPD: {{clamp.config.policy.pap.url}}/policy/api/v1/policytypes/onap.policies.controlloop.operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}/versions/deployed"></log> + <toD + uri="{{clamp.config.policy.pap.url}}/policy/api/v1/policytypes/onap.policies.controlloop.operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}/versions/deployed?bridgeEndpoint=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authMethod=Basic&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}" /> + <doFinally> + <to uri="direct:reset-raise-http-exception-flag" /> + <to + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> + <setProperty propertyName="logMessage"> + <simple>Query closed loop from Policy status</simple> + </setProperty> + <setProperty propertyName="policyStatus"> + <method ref="org.onap.clamp.loop.LoopOperation" + method="analysePolicyResponse(${header.CamelHttpResponseCode})" /> + </setProperty> + <log + loggingLevel="INFO" + message="policy status: ${exchangeProperty[policyStatus]}"></log> + <to uri="direct:dump-loop-log-http-response" /> + </doFinally> + </doTry> + </route> + <route id="get-status-from-dcae"> + <from uri="direct:get-status-from-dcae" /> + <log + loggingLevel="INFO" + message="Query Closed Loop status from DCAE ${exchangeProperty[loopObject].getName()}" /> + <choice> + <when> + <simple>${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()} == null + </simple> + <setProperty propertyName="dcaeStatus"> + <method ref="org.onap.clamp.loop.LoopOperation" + method="analyseDcaeResponse(*,null)" /> + </setProperty> + <log + loggingLevel="INFO" + message="dcae status: ${exchangeProperty[dcaeStatus]}"></log> + </when> + <otherwise> + <doTry> + <log + loggingLevel="INFO" + message="Query Closed Loop status from Dcae" /> + <setHeader headerName="CamelHttpMethod"> + <constant>GET</constant> + </setHeader> + <setHeader headerName="X-ONAP-RequestID"> + <simple>${exchangeProperty[X-ONAP-RequestID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-InvocationID"> + <simple>${exchangeProperty[X-ONAP-InvocationID]} + </simple> + </setHeader> + <setHeader headerName="X-ONAP-PartnerName"> + <simple>${exchangeProperty[X-ONAP-PartnerName]} + </simple> + </setHeader> + <log + loggingLevel="INFO" + message="Endpoint to query Closed Loop status: ${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}"></log> + <toD + uri="${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}?bridgeEndpoint=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authMethod=Basic&authUsername={{clamp.config.dcae.deployment.userName}}&authPassword={{clamp.config.dcae.deployment.password}}" /> + <doFinally> + <to uri="direct:reset-raise-http-exception-flag" /> + <to + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> + <setProperty propertyName="logMessage"> + <simple>Query closed loop from DCAE status</simple> + </setProperty> + <setProperty propertyName="dcaeStatus"> + <method ref="org.onap.clamp.loop.LoopOperation" + method="analyseDcaeResponse(*,${header.CamelHttpResponseCode})" /> + </setProperty> + <log + loggingLevel="INFO" + message="dcae status: ${exchangeProperty[dcaeStatus]}"></log> + <to uri="direct:dump-loop-log-http-response" /> + </doFinally> + </doTry> + </otherwise> + </choice> + </route> <route id="reset-raise-http-exception-flag"> <from uri="direct:reset-raise-http-exception-flag" /> <setProperty propertyName="raiseHttpExceptionFlag"> |