diff options
author | sebdet <sebastien.determe@intl.att.com> | 2019-04-10 14:07:35 +0200 |
---|---|---|
committer | sebdet <sebastien.determe@intl.att.com> | 2019-04-10 14:07:35 +0200 |
commit | cd64cc4b390a15602e084d0d94007ec83aa530a4 (patch) | |
tree | c928f5bc4f9e7b12b2955ec880e69d850cea3073 /src/main/resources | |
parent | 9342b6c9ea3dd02feb9e1d8acc81e5b50c66f1e2 (diff) |
Add delete support
Move delete code to Camel way so that it's more flexible + introduce
removal of the loop + test
Issue-ID: CLAMP-315
Change-Id: I7df87e1441d4511ad6b42d0d269c3b2c8c7d8eef
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'src/main/resources')
-rw-r--r-- | src/main/resources/clds/camel/rest/clamp-api-v2.xml | 89 | ||||
-rw-r--r-- | src/main/resources/clds/camel/routes/flexible-flow.xml | 14 |
2 files changed, 81 insertions, 22 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 8a39f1358..ffa4719f0 100644 --- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -97,14 +97,14 @@ </put> <put uri="/v2/loop/submit/{loopName}"> <route> - <setBody> - <simple>${header.loopName}</simple> - </setBody> <log loggingLevel="INFO" - message="Receive SUBMIT request for loop: ${body}" /> + message="Receive SUBMIT request for loop: ${header.loopName}" /> <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + <setBody> + <simple>${header.loopName}</simple> + </setBody> <to uri="direct:load-loop" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive SUBMIT request','INFO',${header.LoopObject})" /> @@ -120,12 +120,12 @@ <log loggingLevel="INFO" message="Processing Micro Service Policy: ${header.microServicePolicy.getName()}" /> - <setHeader headerName="HttpQueryExceptionFlag"> + <setHeader headerName="RaiseHttpExceptionFlag"> <simple resultType="java.lang.Boolean">false</simple> </setHeader> <to uri="direct:delete-micro-service-policy" /> - <setHeader headerName="HttpQueryExceptionFlag"> + <setHeader headerName="RaiseHttpExceptionFlag"> <simple resultType="java.lang.Boolean">true</simple> </setHeader> <to uri="direct:create-micro-service-policy" /> @@ -143,12 +143,12 @@ <log loggingLevel="INFO" message="Processing Operational Policy: ${header.operationalPolicy.getName()}" /> - <setHeader headerName="HttpQueryExceptionFlag"> + <setHeader headerName="RaiseHttpExceptionFlag"> <simple resultType="java.lang.Boolean">false</simple> </setHeader> <to uri="direct:delete-operational-policy" /> - <setHeader headerName="HttpQueryExceptionFlag"> + <setHeader headerName="RaiseHttpExceptionFlag"> <simple resultType="java.lang.Boolean">true</simple> </setHeader> <to uri="direct:create-operational-policy" /> @@ -165,18 +165,18 @@ loggingLevel="INFO" message="Processing Guard Policy: ${header.guardPolicy.getKey()}" /> - <setHeader headerName="HttpQueryExceptionFlag"> + <setHeader headerName="RaiseHttpExceptionFlag"> <simple resultType="java.lang.Boolean">false</simple> </setHeader> <to uri="direct:delete-guard-policy" /> - <setHeader headerName="HttpQueryExceptionFlag"> + <setHeader headerName="RaiseHttpExceptionFlag"> <simple resultType="java.lang.Boolean">true</simple> </setHeader> <to uri="direct:create-guard-policy" /> </split> </split> - <setHeader headerName="HttpQueryExceptionFlag"> + <setHeader headerName="RaiseHttpExceptionFlag"> <simple resultType="java.lang.Boolean">true</simple> </setHeader> <to uri="direct:create-pdp-group-policy" /> @@ -190,14 +190,73 @@ </put> <put uri="/v2/loop/delete/{loopName}"> <route> + <log + loggingLevel="INFO" + message="Receive DELETE request for loop: ${header.loopName}" /> <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" /> + <setBody> + <simple>${header.loopName}</simple> + </setBody> + <to uri="direct:load-loop" /> <to - uri="bean:org.onap.clamp.operation.LoopOperation?method=deleteMsPolicies(${header.loopName})" /> - <to - uri="bean:org.onap.clamp.operation.LoopOperation?method=deleteOpPolicy(${header.loopName})" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive DELETE request','INFO',${header.LoopObject})" /> + <split> + <simple>${header.LoopObject.getMicroServicePolicies()} + </simple> + <setHeader headerName="microServicePolicy"> + <simple>${body}</simple> + </setHeader> + <log + loggingLevel="INFO" + message="Processing Micro Service Policy: ${header.microServicePolicy.getName()}" /> + <setHeader headerName="RaiseHttpExceptionFlag"> + <simple resultType="java.lang.Boolean">true</simple> + </setHeader> + <to uri="direct:delete-micro-service-policy" /> + </split> + + <log + loggingLevel="INFO" + message="Processing all OPERATIONAL policies defined in loop ${header.LoopObject.getName()}" /> + <split> + <simple>${header.LoopObject.getOperationalPolicies()} + </simple> + <setHeader headerName="operationalPolicy"> + <simple>${body}</simple> + </setHeader> + <log + loggingLevel="INFO" + message="Processing Operational Policy: ${header.operationalPolicy.getName()}" /> + <setHeader headerName="RaiseHttpExceptionFlag"> + <simple resultType="java.lang.Boolean">true</simple> + </setHeader> + <to uri="direct:delete-operational-policy" /> + <log + loggingLevel="INFO" + message="Processing all GUARD policies defined in loop ${header.LoopObject.getName()}" /> + <split> + <simple>${header.operationalPolicy.createGuardPolicyPayloads().entrySet()} + </simple> + <setHeader headerName="guardPolicy"> + <simple>${body}</simple> + </setHeader> + <log + loggingLevel="INFO" + message="Processing Guard Policy: ${header.guardPolicy.getKey()}" /> + + <setHeader headerName="RaiseHttpExceptionFlag"> + <simple resultType="java.lang.Boolean">true</simple> + </setHeader> + <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}" /> <to - uri="bean:org.onap.clamp.operation.LoopOperation?method=deleteGuardPolicy(${header.loopName})" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request successfully executed','INFO',${header.LoopObject})" /> </route> </put> </rest> diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml index 64af7b264..1ce67ccee 100644 --- a/src/main/resources/clds/camel/routes/flexible-flow.xml +++ b/src/main/resources/clds/camel/routes/flexible-flow.xml @@ -120,7 +120,7 @@ loggingLevel="INFO" message="Endpoint to create microservice policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> <toD - uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}" /> + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy created successfully','INFO',${header.LoopObject})" /> </route> @@ -143,7 +143,7 @@ loggingLevel="INFO" message="Endpoint to delete microservice policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> <toD - uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy deleted successfully','INFO',${header.LoopObject})" /> </route> @@ -171,7 +171,7 @@ loggingLevel="INFO" message="Endpoint to create operational policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> <toD - uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}" /> + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy created successfully','INFO',${header.LoopObject})" /> </route> @@ -194,7 +194,7 @@ loggingLevel="INFO" message="Endpoint to delete operational policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> <toD - uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy deleted successfully','INFO',${header.LoopObject})" /> </route> @@ -222,7 +222,7 @@ loggingLevel="INFO" message="Endpoint to create guard policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> <toD - uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}" /> + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy created successfully','INFO',${header.LoopObject})" /> </route> @@ -245,7 +245,7 @@ loggingLevel="INFO" message="Endpoint to delete guard policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> <toD - uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy deleted successfully','INFO',${header.LoopObject})" /> </route> @@ -273,7 +273,7 @@ loggingLevel="INFO" message="Endpoint to create PDP Group policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> <toD - uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}" /> + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Pdp Group created successfully','INFO',${header.LoopObject})" /> </route> |