blob: 1bad5fbbebedcdff293668782d49149d65d04db7 [file] [log] [blame]
<routes xmlns="http://camel.apache.org/schema/spring">
<route id="submit">
<from uri="direct:processSubmit" />
<choice>
<when>
<simple> ${exchangeProperty.actionCd} == 'SUBMIT' ||
${exchangeProperty.actionCd} == 'RESUBMIT'
</simple>
<to
uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
<to uri="bean:org.onap.clamp.clds.client.TcaPolicyDelegate" />
<to uri="bean:org.onap.clamp.clds.client.HolmesPolicyDelegate" />
<delay>
<constant>30000</constant>
</delay>
<to
uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" />
<to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" />
<to
uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
</when>
<when>
<simple> ${exchangeProperty.actionCd} == 'DELETE'</simple>
<to
uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
<to uri="bean:org.onap.clamp.clds.client.TcaPolicyDeleteDelegate" />
<to
uri="bean:org.onap.clamp.clds.client.HolmesPolicyDeleteDelegate" />
<delay>
<constant>30000</constant>
</delay>
<to
uri="bean:org.onap.clamp.clds.client.OperationalPolicyDeleteDelegate" />
<to
uri="bean:org.onap.clamp.clds.client.GuardPolicyDeleteDelegate" />
<to uri="bean:org.onap.clamp.clds.client.ModelDeleteDelegate" />
<to
uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
</when>
<when>
<simple> ${exchangeProperty.actionCd} == 'UPDATE'</simple>
<to
uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
<to uri="bean:org.onap.clamp.clds.client.TcaPolicyDelegate" />
<to uri="bean:org.onap.clamp.clds.client.HolmesPolicyDelegate" />
<delay>
<constant>30000</constant>
</delay>
<to
uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" />
<to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" />
<to
uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
</when>
<when>
<simple> ${exchangeProperty.actionCd} == 'STOP'</simple>
<to
uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
<to
uri="bean:org.onap.clamp.clds.client.OperationalPolicyDeleteDelegate" />
<to
uri="bean:org.onap.clamp.clds.client.GuardPolicyDeleteDelegate" />
<to
uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
</when>
<when>
<simple> ${exchangeProperty.actionCd} == 'RESTART'</simple>
<to
uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
<to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" />
<to
uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" />
<to
uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
</when>
</choice>
</route>
<route id="load-loop">
<from uri="direct:load-loop" />
<setBody>
<simple>${header.loopName}</simple>
</setBody>
<setProperty propertyName="loopObject">
<method
ref="org.onap.clamp.loop.LoopService"
method="getLoop" />
</setProperty>
<when>
<simple>${exchangeProperty[loopObject]} == null</simple>
<setHeader headerName="CamelHttpResponseCode">
<constant>404</constant>
</setHeader>
<log
loggingLevel="WARNING"
message="Loop not found in database: ${body}" />
<stop />
</when>
</route>
<route id="create-micro-service-policy">
<from uri="direct:create-micro-service-policy" />
<doTry>
<log
loggingLevel="INFO"
message="Creating Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Micro Service Policy')" />
<setBody>
<simple>${exchangeProperty[microServicePolicy].createPolicyPayload()}
</simple>
</setBody>
<setHeader headerName="CamelHttpMethod">
<constant>POST</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 create microservice policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies"></log>
<toD
uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.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>${exchangeProperty[microServicePolicy].getName()} creation
status
</simple>
</setProperty>
<to uri="direct:dump-loop-log-http-response" />
</doFinally>
</doTry>
</route>
<route id="delete-micro-service-policy">
<from uri="direct:delete-micro-service-policy" />
<doTry>
<log
loggingLevel="INFO"
message="Deleting Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Micro Service Policy')" />
<setBody>
<constant>null</constant>
</setBody>
<setHeader headerName="CamelHttpMethod">
<constant>DELETE</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 delete microservice policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}/versions/1.0.0"></log>
<toD
uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}/versions/1.0.0?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.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>${exchangeProperty[microServicePolicy].getName()} removal
status
</simple>
</setProperty>
<to uri="direct:dump-loop-log-http-response" />
</doFinally>
</doTry>
</route>
<route id="create-operational-policy">
<from uri="direct:create-operational-policy" />
<doTry>
<log
loggingLevel="INFO"
message="Creating Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Operational Policy')" />
<setBody>
<simple>${exchangeProperty[operationalPolicy].createPolicyPayload()}
</simple>
</setBody>
<setHeader headerName="CamelHttpMethod">
<constant>POST</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 create operational policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies"></log>
<toD
uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.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>${exchangeProperty[operationalPolicy].getName()} creation
status
</simple>
</setProperty>
<to uri="direct:dump-loop-log-http-response" />
</doFinally>
</doTry>
</route>
<route id="delete-operational-policy">
<from uri="direct:delete-operational-policy" />
<doTry>
<log
loggingLevel="INFO"
message="Deleting Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Operational Policy')" />
<setBody>
<constant>null</constant>
</setBody>
<setHeader headerName="CamelHttpMethod">
<constant>DELETE</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 delete operational policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}/versions/1"></log>
<toD
uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}/versions/1?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.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>${exchangeProperty[operationalPolicy].getName()} removal
status
</simple>
</setProperty>
<to uri="direct:dump-loop-log-http-response" />
</doFinally>
</doTry>
</route>
<route id="create-guard-policy">
<from uri="direct:create-guard-policy" />
<doTry>
<log
loggingLevel="INFO"
message="Creating Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Guard Policy')" />
<setBody>
<simple>${exchangeProperty[guardPolicy].getValue()}
</simple>
</setBody>
<setHeader headerName="CamelHttpMethod">
<constant>POST</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 create guard policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies"></log>
<toD
uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.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>${exchangeProperty[guardPolicy].getKey()} creation status
</simple>
</setProperty>
<to uri="direct:dump-loop-log-http-response" />
</doFinally>
</doTry>
</route>
<route id="delete-guard-policy">
<from uri="direct:delete-guard-policy" />
<doTry>
<log
loggingLevel="INFO"
message="Deleting Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Guard Policy')" />
<setBody>
<constant>null</constant>
</setBody>
<setHeader headerName="CamelHttpMethod">
<constant>DELETE</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 delete guard policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}/versions/1"></log>
<toD
uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}/versions/1?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.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>${exchangeProperty[guardPolicy].getKey()} removal status
</simple>
</setProperty>
<to uri="direct:dump-loop-log-http-response" />
</doFinally>
</doTry>
</route>
<route id="add-all-to-active-pdp-group">
<from uri="direct:add-all-to-active-pdp-group" />
<doTry>
<log
loggingLevel="INFO"
message="Adding loop policies to PDP Group: ${exchangeProperty[loopObject].getName()}" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Add policies to PDP group')" />
<setBody>
<simple>${exchangeProperty[loopObject].createPoliciesPayloadPdpGroup()}
</simple>
</setBody>
<setHeader headerName="CamelHttpMethod">
<constant>POST</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 add policies to PDP Group: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies"></log>
<toD
uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies?bridgeEndpoint=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;useSystemProperties=true&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;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>PDP Group push ALL status</simple>
</setProperty>
<to uri="direct:dump-loop-log-http-response" />
</doFinally>
</doTry>
</route>
<route id="remove-all-policy-from-active-pdp-group">
<from uri="direct:remove-all-policy-from-active-pdp-group" />
<doTry>
<log
loggingLevel="INFO"
message="Removing policies from active PDP group for loop: ${exchangeProperty[loopObject].getName()}" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Removing policies PDP group')" />
<split>
<simple>${exchangeProperty[loopObject].listPolicyNamesPdpGroup()}
</simple>
<setProperty propertyName="policyName">
<simple>${body}</simple>
</setProperty>
<setBody>
<constant>null</constant>
</setBody>
<setHeader headerName="CamelHttpMethod">
<constant>DELETE</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 delete policy from PDP Group: {{clamp.config.policy.pap.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0"></log>
<toD
uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}" />
<setProperty propertyName="logMessage">
<simple>${exchangeProperty[policyName]} PDP Group removal status
</simple>
</setProperty>
<to uri="direct:dump-loop-log-http-response" />
</split>
<doCatch>
<exception>java.lang.Exception</exception>
<handled>
<constant>false</constant>
</handled>
<setProperty propertyName="logMessage">
<simple>PDP Group removal, Error reported: ${exception}</simple>
</setProperty>
<to uri="direct:dump-loop-log-http-response" />
</doCatch>
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
</doFinally>
</doTry>
</route>
<route id="deploy-loop">
<from uri="direct:deploy-loop" />
<doTry>
<log
loggingLevel="INFO"
message="Deploying the loop: ${exchangeProperty[loopObject].getName()}" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Deploying the loop')" />
<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 loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}"></log>
<toD
uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;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 loop status (id:${exchangeProperty[deploymentId]})</simple>
</setProperty>
<to uri="direct:dump-loop-log-http-response" />
</doFinally>
</doTry>
</route>
<route id="undeploy-loop">
<from uri="direct:undeploy-loop" />
<doTry>
<log
loggingLevel="INFO"
message="Undeploying the loop: ${exchangeProperty[loopObject].getName()} : ${exchangeProperty[loopObject].getDcaeDeploymentId()}" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Undeploying the 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 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&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;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 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 PDP: ${exchangeProperty[loopObject].getName()}" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Query operational policies to PDP group')" />
<setProperty propertyName="operationalPolicyName">
<method ref="org.onap.clamp.loop.LoopOperation"
method="getOperationalPolicyName(${exchangeProperty[loopObject]})" />
</setProperty>
<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 PDP: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicyName]}/versions/deployed"></log>
<toD
uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicyName]}/versions/deployed?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authMethod=Basic&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;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>Policy deployment status</simple>
</setProperty>
<setProperty propertyName="policyStatus">
<method ref="org.onap.clamp.loop.LoopOperation"
method="analysePolicyResponse(${header.CamelHttpResponseCode})" />
</setProperty>
<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&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=20000&amp;httpClient.socketTimeout=20000&amp;authMethod=Basic&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;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>DCAE deployment 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">
<simple resultType="java.lang.Boolean">true</simple>
</setProperty>
</route>
<route id="dump-loop-log-http-response">
<from uri="direct:dump-loop-log-http-response" />
<log loggingLevel="INFO" message="${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}" />
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO',${exchangeProperty[loopObject]})" />
</route>
</routes>