diff options
Diffstat (limited to 'src/main/resources/clds')
-rw-r--r-- | src/main/resources/clds/camel/rest/clamp-api-v2.xml | 368 | ||||
-rw-r--r-- | src/main/resources/clds/camel/routes/flexible-flow.xml | 823 |
2 files changed, 727 insertions, 464 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 bc1a07fe..4d3c6b38 100644 --- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -5,7 +5,7 @@ outType="java.lang.String[]" produces="application/json"> <route> - <removeHeaders pattern="*"/> + <removeHeaders pattern="*" /> <doTry> <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get All ClosedLoop')" /> @@ -31,7 +31,9 @@ outType="org.onap.clamp.loop.Loop" produces="application/json"> <route> - <removeHeaders pattern="*" excludePattern="loopName"/> + <removeHeaders + pattern="*" + excludePattern="loopName" /> <doTry> <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get Closed Loop')" /> @@ -57,7 +59,9 @@ outType="java.lang.String" produces="application/xml"> <route> - <removeHeaders pattern="*" excludePattern="loopName"/> + <removeHeaders + pattern="*" + excludePattern="loopName" /> <doTry> <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get SVG Representation')" /> @@ -86,7 +90,9 @@ outType="org.onap.clamp.loop.Loop" produces="application/json"> <route> - <removeHeaders pattern="*" excludePattern="loopName"/> + <removeHeaders + pattern="*" + excludePattern="loopName" /> <doTry> <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update the global properties')" /> @@ -120,7 +126,9 @@ outType="org.onap.clamp.loop.Loop" produces="application/json"> <route> - <removeHeaders pattern="*" excludePattern="loopName"/> + <removeHeaders + pattern="*" + excludePattern="loopName" /> <doTry> <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update operational policies')" /> @@ -154,7 +162,9 @@ outType="org.onap.clamp.policy.microservice.MicroServicePolicy" produces="application/json"> <route> - <removeHeaders pattern="*" excludePattern="loopName"/> + <removeHeaders + pattern="*" + excludePattern="loopName" /> <doTry> <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update Microservice policies')" /> @@ -187,14 +197,39 @@ outType="org.onap.clamp.loop.Loop" produces="application/json"> <route> - <removeHeaders pattern="*" excludePattern="loopName"/> + <removeHeaders + pattern="*" + excludePattern="loopName" /> <doTry> <to 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="bean:org.onap.clamp.operation.LoopOperation?method=deployLoop(*,${header.loopName})" /> + 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> + <choice> + <when> + <simple> ${exchangeProperty[policyStatus]} == 'SUBMITTED' and + ${exchangeProperty[dcaeStatus]} == 'NOT_DEPLOYED' + </simple> + <to + uri="direct:deploy-closedloop" /> + </when> + <otherwise> + <log + loggingLevel="INFO" + message="Closed Loop is in state ${exchangeProperty[policyStatus]}, it can only be deployed when in state SUBMIT" /> + <to + 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> <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> @@ -204,6 +239,11 @@ </handled> <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + <log + loggingLevel="ERROR" + 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]})" /> </doCatch> </doTry> </route> @@ -213,14 +253,33 @@ outType="org.onap.clamp.loop.Loop" produces="application/json"> <route> - <removeHeaders pattern="*" excludePattern="loopName"/> + <removeHeaders + pattern="*" + excludePattern="loopName" /> <doTry> <to 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="bean:org.onap.clamp.operation.LoopOperation?method=unDeployLoop(${header.loopName})" /> + uri="direct:load-loop" /> + <to + uri="direct:get-status-from-dcae" /> + <choice> + <when> + <simple> ${exchangeProperty[dcaeStatus]} == 'DEPLOYED' + </simple> + <to + uri="direct:undeploy-closedloop" /> + </when> + <otherwise> + <log + loggingLevel="INFO" + message="Closed Loop is in state ${exchangeProperty[dcaeStatus]}, it can only be undeployed when in state DEPLOYED" /> + <to + 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> <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> <doCatch> @@ -230,6 +289,11 @@ </handled> <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + <log + loggingLevel="ERROR" + 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]})" /> </doCatch> </doTry> </route> @@ -239,7 +303,9 @@ outType="org.onap.clamp.loop.Loop" produces="application/json"> <route> - <removeHeaders pattern="*" excludePattern="loopName"/> + <removeHeaders + pattern="*" + excludePattern="loopName" /> <doTry> <log loggingLevel="INFO" @@ -249,20 +315,7 @@ <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <to uri="direct:load-loop" /> - - <doTry> - <to uri="direct:remove-all-policy-from-active-pdp-group" /> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doCatch> - </doTry> - - + <to uri="direct:remove-all-policy-from-active-pdp-group" /> <log loggingLevel="INFO" message="STOP request successfully executed for loop: ${body}" /> @@ -279,6 +332,11 @@ </handled> <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + <log + loggingLevel="ERROR" + message="STOP request failed for loop: $${header.loopName}" /> + <to + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" /> </doCatch> </doTry> </route> @@ -288,7 +346,9 @@ outType="org.onap.clamp.loop.Loop" produces="application/json"> <route> - <removeHeaders pattern="*" excludePattern="loopName"/> + <removeHeaders + pattern="*" + excludePattern="loopName" /> <doTry> <log loggingLevel="INFO" @@ -299,21 +359,11 @@ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> <to uri="direct:load-loop" /> - <doTry> - <to uri="direct:add-all-to-active-pdp-group" /> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doCatch> - </doTry> + <to uri="direct:add-all-to-active-pdp-group" /> <log loggingLevel="INFO" - message="START request successfully executed for loop: ${body}" /> + message="START request successfully executed for loop: ${header.loopName}" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request successfully executed','INFO',${exchangeProperty[loopObject]})" /> <to @@ -327,6 +377,11 @@ </handled> <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + <log + loggingLevel="ERROR" + message="START request failed for loop: ${header.loopName}" /> + <to + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request failed, Error reported: ${exception}','INFO',${exchangeProperty[loopObject]})" /> </doCatch> </doTry> </route> @@ -336,7 +391,9 @@ outType="org.onap.clamp.loop.Loop" produces="application/json"> <route> - <removeHeaders pattern="*" excludePattern="loopName"/> + <removeHeaders + pattern="*" + excludePattern="loopName" /> <doTry> <log loggingLevel="INFO" @@ -351,19 +408,7 @@ <setProperty propertyName="raiseHttpExceptionFlag"> <simple resultType="java.lang.Boolean">false</simple> </setProperty> - - <doTry> - <to uri="direct:remove-all-policy-from-active-pdp-group" /> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doCatch> - </doTry> - + <to uri="direct:remove-all-policy-from-active-pdp-group" /> <log loggingLevel="INFO" message="Processing all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}" /> @@ -379,31 +424,8 @@ <setProperty propertyName="raiseHttpExceptionFlag"> <simple resultType="java.lang.Boolean">false</simple> </setProperty> - - <doTry> - <to uri="direct:delete-micro-service-policy" /> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doCatch> - </doTry> - - <doTry> - <to uri="direct:create-micro-service-policy" /> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doCatch> - </doTry> - + <to uri="direct:delete-micro-service-policy" /> + <to uri="direct:create-micro-service-policy" /> </split> <log loggingLevel="INFO" @@ -421,30 +443,8 @@ <simple resultType="java.lang.Boolean">false</simple> </setProperty> - <doTry> - <to uri="direct:delete-operational-policy" /> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doCatch> - </doTry> - - <doTry> - <to uri="direct:create-operational-policy" /> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doCatch> - </doTry> - + <to uri="direct:delete-operational-policy" /> + <to uri="direct:create-operational-policy" /> <log loggingLevel="INFO" @@ -462,52 +462,16 @@ <setProperty propertyName="raiseHttpExceptionFlag"> <simple resultType="java.lang.Boolean">false</simple> </setProperty> - - <doTry> - <to uri="direct:delete-guard-policy" /> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doCatch> - </doTry> - - <doTry> - <to uri="direct:create-guard-policy" /> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doCatch> - </doTry> - + <to uri="direct:delete-guard-policy" /> + <to uri="direct:create-guard-policy" /> </split> </split> - - <doTry> - <to uri="direct:add-all-to-active-pdp-group" /> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doCatch> - </doTry> - - + <to uri="direct:add-all-to-active-pdp-group" /> <log loggingLevel="INFO" - message="SUBMIT request successfully executed for loop: ${body}" /> + message="SUBMIT request successfully executed for loop: ${header.loopName}" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" /> <to @@ -521,13 +485,20 @@ </handled> <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + <log + loggingLevel="ERROR" + message="SUBMIT request failed for loop: ${header.loopName}" /> + <to + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" /> </doCatch> </doTry> </route> </put> <put uri="/v2/loop/delete/{loopName}"> <route> - <removeHeaders pattern="*" excludePattern="loopName"/> + <removeHeaders + pattern="*" + excludePattern="loopName" /> <doTry> <log loggingLevel="INFO" @@ -539,20 +510,7 @@ <to uri="direct:load-loop" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive DELETE request','INFO',${exchangeProperty[loopObject]})" /> - - <doTry> - <to uri="direct:remove-all-policy-from-active-pdp-group" /> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doCatch> - </doTry> - - + <to uri="direct:remove-all-policy-from-active-pdp-group" /> <split> <simple>${exchangeProperty[loopObject].getMicroServicePolicies()} </simple> @@ -562,19 +520,7 @@ <log loggingLevel="INFO" message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" /> - - <doTry> - <to uri="direct:delete-micro-service-policy" /> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doCatch> - </doTry> - + <to uri="direct:delete-micro-service-policy" /> </split> <log @@ -589,19 +535,7 @@ <log loggingLevel="INFO" message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" /> - - <doTry> - <to uri="direct:delete-operational-policy" /> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doCatch> - </doTry> - + <to uri="direct:delete-operational-policy" /> <log loggingLevel="INFO" message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" /> @@ -614,26 +548,14 @@ <log loggingLevel="INFO" message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" /> - - <doTry> - <to uri="direct:delete-guard-policy" /> - <doCatch> - <exception>java.lang.Exception</exception> - <handled> - <constant>false</constant> - </handled> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> - </doCatch> - </doTry> - + <to uri="direct:delete-guard-policy" /> </split> </split> <to uri="bean:org.onap.clamp.loop.log.LoopService?method=deleteLoop(${header.loopName})" /> <log loggingLevel="INFO" - message="DELETE request successfully executed for loop: ${body}" /> + message="DELETE request successfully executed for loop: ${header.loopName}" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request successfully executed','INFO',${exchangeProperty[loopObject]})" /> <to @@ -645,9 +567,63 @@ </handled> <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + <log + loggingLevel="ERROR" + message="DELETE request failed for loop: ${header.loopName}" /> + <to + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" /> </doCatch> </doTry> </route> </put> + <get + uri="/v2/loop/getstatus/{loopName}" + outType="org.onap.clamp.loop.Loop" + produces="application/json"> + <route> + <removeHeaders pattern="*" excludePattern="loopName"/> + <doTry> + <log + loggingLevel="INFO" + message="Get current status for loop: ${header.loopName}" /> + <to + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get the closed loop status')" /> + <to + uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" /> + <to uri="direct:load-loop" /> + <to + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive 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}" /> + <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.loop.LoopController?method=getLoop(${header.loopName})" /> + <to + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" /> + <doCatch> + <exception>java.lang.Exception</exception> + <handled> + <constant>false</constant> + </handled> + <to + uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" /> + <log + 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]})" /> + </doCatch> + </doTry> + </route> + </get> </rest> </rests> diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml index 22450205..5f857772 100644 --- a/src/main/resources/clds/camel/routes/flexible-flow.xml +++ b/src/main/resources/clds/camel/routes/flexible-flow.xml @@ -101,304 +101,420 @@ <route id="create-micro-service-policy"> <from uri="direct:create-micro-service-policy" /> - - <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.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies"></log> - <toD - uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> - <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy created successfully','INFO',${exchangeProperty[loopObject]})" /> - <to uri="direct:reset-raise-http-exception-flag" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> + <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&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.api.userName}}&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&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}" /> - <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.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}"></log> - <toD - uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> - <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy deleted successfully','INFO',${exchangeProperty[loopObject]})" /> - <to uri="direct:reset-raise-http-exception-flag" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> + <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" /> - - <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/yaml; legacy-version</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.url}}/policy/api/v1/policytypes/onap.policies.controlloop.operational/versions/1.0.0/policies"></log> - <toD - uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policies.controlloop.operational/versions/1.0.0/policies?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> - <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy created successfully','INFO',${exchangeProperty[loopObject]})" /> - <to uri="direct:reset-raise-http-exception-flag" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> + <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&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.api.userName}}&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" /> - - <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.url}}/policy/api/v1/policytypes/onap.policies.controlloop.operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}"></log> - <toD - uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policies.controlloop.operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> - <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy deleted successfully','INFO',${exchangeProperty[loopObject]})" /> - <to uri="direct:reset-raise-http-exception-flag" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> + <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.0.0"></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.0.0?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.api.userName}}&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" /> - - <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.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies"></log> - <toD - uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> - <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy created successfully','INFO',${exchangeProperty[loopObject]})" /> - <to uri="direct:reset-raise-http-exception-flag" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> + <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&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.api.userName}}&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.0.0"></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.0.0?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}" /> - <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.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}"></log> - <toD - uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}?bridgeEndpoint=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> - <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy deleted successfully','INFO',${exchangeProperty[loopObject]})" /> - <to uri="direct:reset-raise-http-exception-flag" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> + <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"></log> + <toD + uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps?bridgeEndpoint=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&useSystemProperties=true&authUsername={{clamp.config.policy.pap.userName}}&authPassword={{clamp.config.policy.pap.password}}" /> - <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.url}}/policy/pap/v1/pdps"></log> - <toD - uri="{{clamp.config.policy.url}}/policy/pap/v1/pdps?throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authMethod=Basic&authUsername=test&authPassword=test" /> - <to - uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Policies pushed to PDP Group successfully','INFO',${exchangeProperty[loopObject]})" /> - <to uri="direct:reset-raise-http-exception-flag" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> + <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" /> - <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()} + <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&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.pap.userName}}&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-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="policyName"> + <setProperty propertyName="operationalPolicy"> <simple>${body}</simple> </setProperty> <setBody> - <constant>null</constant> + <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>DELETE</constant> + <constant>PUT</constant> + </setHeader> + <setHeader headerName="Content-Type"> + <constant>application/json</constant> </setHeader> <setHeader headerName="X-ONAP-RequestID"> <simple>${exchangeProperty[X-ONAP-RequestID]} @@ -414,21 +530,192 @@ </setHeader> <log loggingLevel="INFO" - message="Endpoint to delete policy from PDP Group: {{clamp.config.policy.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0"></log> + message="Endpoint to deploy closed loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}"></log> <toD - uri="{{clamp.config.policy.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> + uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}?bridgeEndpoint=true&useSystemProperties=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.log.LoopLogService?method=addLog(${exchangeProperty[policyName]}' Policy removed from PDP Group successfully','INFO',${exchangeProperty[loopObject]})" /> - </split> - <to uri="direct:reset-raise-http-exception-flag" /> - <to - uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" /> + 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&useSystemProperties=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 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&useSystemProperties=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> + <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&useSystemProperties=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"> <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>
\ No newline at end of file |