aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/resources/clds
diff options
context:
space:
mode:
authorSébastien Determe <sebastien.determe@intl.att.com>2020-02-10 09:52:42 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-10 09:52:42 +0000
commitb398c32d092ca7ca14fa37d22fae6cbc1710e66e (patch)
tree06f46938dfc31e6c891b52b0658d1c091354434a /src/main/resources/clds
parent899c22fccf12f50a877988c62e30d5e2c7fb7e3c (diff)
parent81c1344c018e995e4f6f906435d0faab3480e13b (diff)
Merge "Update get Dcae Status flow"
Diffstat (limited to 'src/main/resources/clds')
-rw-r--r--src/main/resources/clds/camel/routes/dcae-flows.xml47
-rw-r--r--src/main/resources/clds/camel/routes/loop-flows.xml103
2 files changed, 95 insertions, 55 deletions
diff --git a/src/main/resources/clds/camel/routes/dcae-flows.xml b/src/main/resources/clds/camel/routes/dcae-flows.xml
index 7137bab92..8088c2a40 100644
--- a/src/main/resources/clds/camel/routes/dcae-flows.xml
+++ b/src/main/resources/clds/camel/routes/dcae-flows.xml
@@ -3,12 +3,12 @@
<from uri="direct:deploy-loop" />
<choice>
<when>
- <simple>${exchangeProperty['loopObject'].getLoopTemplate().getBlueprint()} != null
+ <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == true
</simple>
<to uri="direct:deploy-loop-single-blueprint" />
</when>
<when>
- <simple>${exchangeProperty['loopObject'].getLoopTemplate().getBlueprint()} == null
+ <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == false
</simple>
<to uri="direct:deploy-loop-multi-blueprint" />
</when>
@@ -74,18 +74,14 @@
</setProperty>
<to
uri="bean:org.onap.clamp.policy.microservice.MicroServicePolicyService?method=updateDcaeDeploymentFields(${exchangeProperty[microServicePolicy]},${exchangeProperty[dcaeDeploymentId]},${exchangeProperty[dcaeStatusUrl]})" />
- <setProperty propertyName="logMessage">
- <simple>DEPLOY loop status
- (Dep-id:${exchangeProperty[dcaeDeploymentId]},
- StatusUrl:${exchangeProperty[dcaeStatusUrl]})
- </simple>
- </setProperty>
- <setProperty propertyName="logComponent">
- <simple>DCAE</simple>
- </setProperty>
- <to uri="direct:dump-loop-log-http-response" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLogForComponent('Deploy for the micro service: ${exchangeProperty[microServicePolicy].getName()} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO','DCAE',${exchangeProperty[loopObject]})" />
</split>
<doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
<setProperty propertyName="logMessage">
<simple>DEPLOY micro service failed
(MicroService name:${exchangeProperty[microServicePolicy].getName()}),
@@ -176,12 +172,12 @@
<from uri="direct:undeploy-loop" />
<choice>
<when>
- <simple>${exchangeProperty['loopObject'].getLoopTemplate().getBlueprint()} != null
+ <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == true
</simple>
<to uri="direct:undeploy-loop-single-blueprint" />
</when>
<when>
- <simple>${exchangeProperty['loopObject'].getLoopTemplate().getBlueprint()} == null
+ <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == false
</simple>
<to uri="direct:undeploy-loop-multi-blueprint" />
</when>
@@ -244,25 +240,22 @@
</setProperty>
<to
uri="bean:org.onap.clamp.policy.microservice.MicroServicePolicyService?method=updateDcaeDeploymentFields(${exchangeProperty[microServicePolicy]},${exchangeProperty[microServicePolicy].getDcaeDeploymentId()},${exchangeProperty[dcaeStatusUrl]})" />
- <setProperty propertyName="logMessage">
- <simple>UNDEPLOY micro service successful
- (MicroService name:${exchangeProperty[microServicePolicy].getName()})
- </simple>
- </setProperty>
- <setProperty propertyName="logComponent">
- <simple>DCAE</simple>
- </setProperty>
- <to uri="direct:dump-loop-log-http-response" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLogForComponent('Undeploy for the micro service: ${exchangeProperty[microServicePolicy].getName()} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO','DCAE',${exchangeProperty[loopObject]})" />
</when>
<otherwise>
<log loggingLevel="WARNING"
message="Cannot Undeploy for the micro service: ${exchangeProperty[microServicePolicy].getName()}, the Deployment ID does not exist !" />
<to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Cannot Undeploy for the micro service: ${exchangeProperty[microServicePolicy].getName()}, the Deployment ID does not exist !','WARNING',${exchangeProperty[loopObject]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLogForComponent('Cannot Undeploy for the micro service: ${exchangeProperty[microServicePolicy].getName()}, the Deployment ID does not exist !','WARNING','DCAE',${exchangeProperty[loopObject]})" />
</otherwise>
</choice>
</split>
<doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
<setProperty propertyName="logMessage">
<simple>UNDEPLOY micro service failed
(MicroService name:${exchangeProperty[microServicePolicy].getName()})
@@ -355,7 +348,7 @@
<route id="get-dcae-deployment-status">
<from uri="direct:get-dcae-deployment-status" />
<log loggingLevel="INFO"
- message="Getting DCAE deployment status for loop: ${exchangeProperty[loopObject].getName()}" />
+ message="Getting DCAE deployment status for loop: ${exchangeProperty[loopObject].getName()} - ${exchangeProperty[dcaeComponent].getComponentName()}" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Getting Deployment status')" />
<doTry>
@@ -375,9 +368,9 @@
</simple>
</setHeader>
<log loggingLevel="INFO"
- message="Endpoint to query Closed Loop status: ${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}"></log>
+ message="Endpoint to query Closed Loop status: ${exchangeProperty[getStatusUrl]}"></log>
<toD
- uri="${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=30000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
+ uri="${exchangeProperty[getStatusUrl]}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=30000&amp;authenticationPreemptive=true&amp;connectionClose=true" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
<to
diff --git a/src/main/resources/clds/camel/routes/loop-flows.xml b/src/main/resources/clds/camel/routes/loop-flows.xml
index 57d32f0fe..c4e9fee6d 100644
--- a/src/main/resources/clds/camel/routes/loop-flows.xml
+++ b/src/main/resources/clds/camel/routes/loop-flows.xml
@@ -108,37 +108,84 @@
<from uri="direct:update-dcae-status-for-loop" />
<log loggingLevel="INFO"
message="Updating DCAE status for loop: ${exchangeProperty[loopObject].getName()}" />
- <setProperty propertyName="dcaeComponent">
- <simple>${exchangeProperty[loopObject].getComponent('DCAE')}</simple>
- </setProperty>
- <when>
- <simple>${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}
- != null
- </simple>
- <setProperty propertyName="raiseHttpExceptionFlag">
- <simple resultType="java.lang.Boolean">false</simple>
- </setProperty>
- <to uri="direct:get-dcae-deployment-status" />
+ <choice>
<when>
- <simple> ${header.CamelHttpResponseCode} == 200 </simple>
- <convertBodyTo type="java.lang.String" />
- <setProperty propertyName="dcaeResponse">
- <method ref="org.onap.clamp.loop.components.external.DcaeComponent"
- method="convertDcaeResponse(${body})" />
+ <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == true
+ </simple>
+ <setProperty propertyName="dcaeComponent">
+ <simple>${exchangeProperty[loopObject].getComponent('DCAE')}</simple>
+ </setProperty>
+ <when>
+ <simple>${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()} != null
+ </simple>
+ <setProperty propertyName="getStatusUrl">
+ <simple>${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}</simple>
+ </setProperty>
+ <setProperty propertyName="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">false</simple>
+ </setProperty>
+ <to uri="direct:get-dcae-deployment-status" />
+ <when>
+ <simple> ${header.CamelHttpResponseCode} == 200 </simple>
+ <convertBodyTo type="java.lang.String" />
+ <setProperty propertyName="dcaeResponse">
+ <method ref="org.onap.clamp.loop.components.external.DcaeComponent"
+ method="convertDcaeResponse(${body})" />
+ </setProperty>
+ </when>
+ </when>
+ <setProperty propertyName="dcaeState">
+ <simple> ${exchangeProperty[dcaeComponent].computeState(*)}
+ </simple>
</setProperty>
+ <log loggingLevel="INFO"
+ message="DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - DCAE message: ${exchangeProperty[dcaeResponse].getError()}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLogForComponent('DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - message: ${exchangeProperty[dcaeResponse].getError()}','INFO','DCAE',${exchangeProperty[loopObject]})" />
</when>
- </when>
-
- <setProperty propertyName="dcaeState">
- <simple> ${exchangeProperty[dcaeComponent].computeState(*)}
- </simple>
- </setProperty>
- <log loggingLevel="INFO"
- message="DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - DCAE message: ${exchangeProperty[dcaeResponse].getError()}" />
- <to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLogForComponent('DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - message: ${exchangeProperty[dcaeResponse].getError()}','INFO','DCAE',${exchangeProperty[loopObject]})" />
-
- </route>
+ <when>
+ <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == false
+ </simple>
+ <split>
+ <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
+ </simple>
+ <setProperty propertyName="microServicePolicy">
+ <simple>${body}</simple>
+ </setProperty>
+ <setProperty propertyName="dcaeComponent">
+ <simple>${exchangeProperty[loopObject].getComponent('DCAE_' + ${exchangeProperty[microServicePolicy].getName())}</simple>
+ </setProperty>
+ <when>
+ <simple>${exchangeProperty[microServicePolicy].getDcaeDeploymentStatusUrl()} != null
+ </simple>
+ <setProperty propertyName="getStatusUrl">
+ <simple>${exchangeProperty[microServicePolicy].getDcaeDeploymentStatusUrl()}</simple>
+ </setProperty>
+ <setProperty propertyName="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">false</simple>
+ </setProperty>
+ <to uri="direct:get-dcae-deployment-status" />
+ <when>
+ <simple> ${header.CamelHttpResponseCode} == 200 </simple>
+ <convertBodyTo type="java.lang.String" />
+ <setProperty propertyName="dcaeResponse">
+ <method ref="org.onap.clamp.loop.components.external.DcaeComponent"
+ method="convertDcaeResponse(${body})" />
+ </setProperty>
+ </when>
+ </when>
+ <setProperty propertyName="dcaeState">
+ <simple> ${exchangeProperty[dcaeComponent].computeState(*)}
+ </simple>
+ </setProperty>
+ <log loggingLevel="INFO"
+ message="DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - DCAE message: ${exchangeProperty[dcaeResponse].getError()}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLogForComponent('DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - message: ${exchangeProperty[dcaeResponse].getError()}','INFO','DCAE',${exchangeProperty[microServicePolicy]})" />
+ </split>>
+ </when>
+ </choice>
+ </route>
<route id="direct:update-loop-state">
<from uri="direct:update-loop-state" />
<log loggingLevel="INFO"