summaryrefslogtreecommitdiffstats
path: root/src/main/resources/clds/camel
diff options
context:
space:
mode:
authorxuegao <xg353y@intl.att.com>2020-04-21 18:05:44 +0200
committerxuegao <xg353y@intl.att.com>2020-04-22 10:12:34 +0200
commitc4f54bf8f8520cb270ad3d7f8c91e12a951f138a (patch)
treebb16683a68e5b1cdcd2bcfb59cc7518ef8cfbbf8 /src/main/resources/clds/camel
parent334ad564f969cb9d3ba1e47f5722ea43c71ee63f (diff)
Guard policy clean up
Remove guard policy related code, so that it will not be shown or created in the legacy policy UI. Issue-ID: CLAMP-825 Change-Id: I6c654fef9fd9df810fd48600c91ffef96db371cd Signed-off-by: xuegao <xg353y@intl.att.com>
Diffstat (limited to 'src/main/resources/clds/camel')
-rw-r--r--src/main/resources/clds/camel/rest/clamp-api-v2.xml49
-rw-r--r--src/main/resources/clds/camel/routes/loop-flows.xml26
-rw-r--r--src/main/resources/clds/camel/routes/policy-flows.xml95
3 files changed, 4 insertions, 166 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 879c9b70..88d58260 100644
--- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -157,7 +157,7 @@
<to
uri="bean:org.onap.clamp.loop.LoopController?method=updateOperationalPolicies(${header.loopName},${header.OperationalPoliciesArray})" />
<to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational and Guard policies UPDATED','INFO',${exchangeProperty[loopObject]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policies UPDATED','INFO',${exchangeProperty[loopObject]})" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
<doCatch>
@@ -532,29 +532,6 @@
<to uri="direct:delete-policy" />
<to uri="direct:create-policy" />
- <choice>
- <when>
- <simple>${exchangeProperty['policy'].isLegacy()} == true
- </simple>
- <log loggingLevel="INFO"
- message="Processing all GUARD policies (LEGACY) defined in loop ${exchangeProperty[loopObject].getName()}" />
- <split>
- <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
- </simple>
- <setProperty propertyName="guardPolicy">
- <simple>${body}</simple>
- </setProperty>
- <log loggingLevel="INFO"
- message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
-
- <setProperty propertyName="raiseHttpExceptionFlag">
- <simple resultType="java.lang.Boolean">false</simple>
- </setProperty>
- <to uri="direct:delete-guard-policy" />
- <to uri="direct:create-guard-policy" />
- </split>
- </when>
- </choice>
</split>
<delay>
@@ -634,27 +611,6 @@
<simple resultType="java.lang.Boolean">false</simple>
</setProperty>
<to uri="direct:delete-policy" />
- <choice>
- <when>
- <simple>${exchangeProperty['policy'].isLegacy()} == true
- </simple>
- <log loggingLevel="INFO"
- message="Deleting all GUARD policies (LEGACY) defined in loop ${exchangeProperty[loopObject].getName()}" />
- <split>
- <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
- </simple>
- <setProperty propertyName="guardPolicy">
- <simple>${body}</simple>
- </setProperty>
- <log loggingLevel="INFO"
- message="Deleting Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
- <setProperty propertyName="raiseHttpExceptionFlag">
- <simple resultType="java.lang.Boolean">false</simple>
- </setProperty>
- <to uri="direct:delete-guard-policy" />
- </split>
- </when>
- </choice>
</split>
<to
uri="bean:org.onap.clamp.loop.LoopController?method=deleteLoop(${header.loopName})" />
@@ -759,8 +715,9 @@
<constant>500</constant>
</setHeader>
<setBody>
- <simple>ADD Operational policy request FAILED</simple>
+ <simple>ADD Operational policy request FAILED for loop: ${header.loopName}, ${exception.message}"</simple>
</setBody>
+
</doCatch>
</doTry>
</route>
diff --git a/src/main/resources/clds/camel/routes/loop-flows.xml b/src/main/resources/clds/camel/routes/loop-flows.xml
index 2f4d9c8c..691656d8 100644
--- a/src/main/resources/clds/camel/routes/loop-flows.xml
+++ b/src/main/resources/clds/camel/routes/loop-flows.xml
@@ -87,32 +87,8 @@
<constant>null</constant>
</setBody>
<log loggingLevel="INFO"
- message="Processing Micro Service Policy: ${exchangeProperty[policyName]} of type ${exchangeProperty[policyType]}" />
+ message="Processing Operational Policy: ${exchangeProperty[policyName]} of type ${exchangeProperty[policyType]}" />
<to uri="direct:verify-one-policy" />
- <log loggingLevel="INFO"
- message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
- <split>
- <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
- </simple>
- <setProperty propertyName="policyName">
- <simple>${body.getKey()}</simple>
- </setProperty>
- <setProperty propertyName="policyType">
- <simple>onap.policies.controlloop.Guard</simple>
- </setProperty>
- <setProperty propertyName="policyTypeVersion">
- <simple>1.0.0</simple>
- </setProperty>
- <setProperty propertyName="policyVersion">
- <simple>1</simple>
- </setProperty>
- <setBody>
- <constant>null</constant>
- </setBody>
- <log loggingLevel="INFO"
- message="Processing Guard Policy: ${exchangeProperty[policyName]} of type ${exchangeProperty[policyType]}" />
- <to uri="direct:verify-one-policy" />
- </split>
</split>
<setProperty propertyName="policyState">
<simple> ${exchangeProperty[policyComponent].getState()}
diff --git a/src/main/resources/clds/camel/routes/policy-flows.xml b/src/main/resources/clds/camel/routes/policy-flows.xml
index 1731308e..f597bdc0 100644
--- a/src/main/resources/clds/camel/routes/policy-flows.xml
+++ b/src/main/resources/clds/camel/routes/policy-flows.xml
@@ -313,101 +313,6 @@
</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;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
- <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>
- <setProperty propertyName="logComponent">
- <simple>POLICY</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;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
-
- <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>
- <setProperty propertyName="logComponent">
- <simple>POLICY</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>