From 667cb72d3ab1578afc78a77c72b65238df741cd1 Mon Sep 17 00:00:00 2001 From: sebdet Date: Thu, 11 Apr 2019 02:07:44 +0200 Subject: Add pdp group Add pdp group code to add/remove policies from active PDP group Issue-ID: CLAMP-303 Change-Id: I3fcffd229bc7703231b813948aac14ce63437127 Signed-off-by: sebdet --- .../resources/clds/camel/rest/clamp-api-v2.xml | 73 ++++++++++---------- .../resources/clds/camel/routes/flexible-flow.xml | 78 ++++++++++++++++++++-- 2 files changed, 110 insertions(+), 41 deletions(-) (limited to 'src/main/resources') 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 ffa4719f0..e6dc27cec 100644 --- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -43,8 +43,14 @@ + + ${body} + + + + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Global Properties UPDATED','INFO',${header.LoopObject})" /> + + ${body} + + + uri="bean:org.onap.clamp.loop.LoopController?method=updateOperationalPolicies(${header.loopName},${header.OperationalPoliciesArray})" /> + + + ${body} + + + + uri="bean:org.onap.clamp.loop.LoopController?method=updateMicroservicePolicy(${header.loopName},${header.MicroServicePolicyObject})" /> + - + - - ${header.loopName} - + + false + + @@ -125,9 +148,6 @@ - - true - @@ -148,9 +168,6 @@ - - true - - - true - - - true - - - + + + @@ -195,12 +208,10 @@ message="Receive DELETE request for loop: ${header.loopName}" /> - - ${header.loopName} - + ${header.LoopObject.getMicroServicePolicies()} @@ -210,9 +221,7 @@ - - true - + @@ -228,9 +237,7 @@ - - true - + - - true - - + diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml index 1f3e01e27..3e69fa44a 100644 --- a/src/main/resources/clds/camel/routes/flexible-flow.xml +++ b/src/main/resources/clds/camel/routes/flexible-flow.xml @@ -78,6 +78,9 @@ + + ${header.loopName} + - + @@ -123,9 +126,11 @@ uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> + + @@ -146,10 +151,12 @@ uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> + + @@ -174,9 +181,11 @@ uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> + + @@ -197,10 +206,12 @@ uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> + + @@ -225,9 +236,11 @@ uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> + + @@ -248,13 +261,14 @@ uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> + - - - + + + + message="Adding loop policies to PDP Group: ${header.LoopObject.getName()}" /> ${header.LoopObject.createPoliciesPayloadPdpGroup()} @@ -271,10 +285,60 @@ + message="Endpoint to add policies to PDP Group: ${header.CamelHttpMethod} ${header.CamelHttpUri}"> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Policies pushed to PDP Group successfully','INFO',${header.LoopObject})" /> + + + + + + + + + ${header.LoopObject.listPolicyNamesPdpGroup()} + + ${body} + + + null + + + DELETE + + + {{clamp.config.policy.url}}/pdps/policies/${header.PolicyName}/versions/1.0.0 + + + + + + + + + + + + + ${header.RaiseHttpExceptionFlag} == null + + true + + + + + + + + null + \ No newline at end of file -- cgit 1.2.3-korg