summaryrefslogtreecommitdiffstats
path: root/src/main/resources
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2019-04-11 17:58:36 +0200
committersebdet <sebastien.determe@intl.att.com>2019-04-11 17:58:36 +0200
commit1efe60f3c5c2160b0cb107cba90284161cc5235d (patch)
tree9e12310775c722e71a6b91d5f13898c99d29ef46 /src/main/resources
parent704306ca20ae5b96bfddedd3e8410b3f62cd81d5 (diff)
Add Start/stop routes
Add Start/stop routes for policy control, it's obviously working the PDP group Issue-ID: CLAMP-303 Change-Id: I16cafa46ee39b6114af9b36f7382b7c2401edaf1 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.xml42
-rw-r--r--src/main/resources/clds/camel/routes/flexible-flow.xml45
2 files changed, 59 insertions, 28 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 e6dc27cec..a823c09da 100644
--- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -115,6 +115,48 @@
</route>
</put>
<put
+ uri="/v2/loop/stop/{loopName}"
+ outType="org.onap.clamp.loop.Loop"
+ produces="application/json">
+ <route>
+ <log
+ loggingLevel="INFO"
+ message="Receive STOP request for loop: ${header.loopName}" />
+ </route>
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+ <to uri="direct:load-loop" />
+ <to uri="direct:remove-all-policy-from-active-pdp-group" />
+ <log
+ loggingLevel="INFO"
+ message="STOP request successfully executed for loop: ${body}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${header.LoopObject})" />
+ <to
+ uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
+ </put>
+ <put
+ uri="/v2/loop/start/{loopName}"
+ outType="org.onap.clamp.loop.Loop"
+ produces="application/json">
+ <route>
+ <log
+ loggingLevel="INFO"
+ message="Receive START request for loop: ${header.loopName}" />
+ </route>
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+ <to uri="direct:load-loop" />
+ <to uri="direct:add-all-to-active-pdp-group" />
+ <log
+ loggingLevel="INFO"
+ message="START request successfully executed for loop: ${body}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request successfully executed','INFO',${header.LoopObject})" />
+ <to
+ uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
+ </put>
+ <put
uri="/v2/loop/submit/{loopName}"
outType="org.onap.clamp.loop.Loop"
produces="application/json">
diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml
index 3e69fa44a..683737af3 100644
--- a/src/main/resources/clds/camel/routes/flexible-flow.xml
+++ b/src/main/resources/clds/camel/routes/flexible-flow.xml
@@ -101,7 +101,7 @@
<route id="create-micro-service-policy">
<from uri="direct:create-micro-service-policy" />
- <to uri="direct:check-raise-http-exception-flag" />
+
<log
loggingLevel="INFO"
message="Creating Micro Service Policy: ${header.microServicePolicy.getName()}" />
@@ -123,14 +123,14 @@
loggingLevel="INFO"
message="Endpoint to create microservice policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
<toD
- uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
+ uri="http4://policyhost:8085?mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy created successfully','INFO',${header.LoopObject})" />
<to uri="direct:reset-raise-http-exception-flag" />
</route>
<route id="delete-micro-service-policy">
<from uri="direct:delete-micro-service-policy" />
- <to uri="direct:check-raise-http-exception-flag" />
+
<log
loggingLevel="INFO"
message="Deleting Micro Service Policy: ${header.microServicePolicy.getName()}" />
@@ -148,7 +148,7 @@
loggingLevel="INFO"
message="Endpoint to delete microservice policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
<toD
- uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
+ uri="http4://policyhost:8085?mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy deleted successfully','INFO',${header.LoopObject})" />
<to uri="direct:reset-raise-http-exception-flag" />
@@ -156,7 +156,7 @@
<route id="create-operational-policy">
<from uri="direct:create-operational-policy" />
- <to uri="direct:check-raise-http-exception-flag" />
+
<log
loggingLevel="INFO"
message="Creating Operational Policy: ${header.operationalPolicy.getName()}" />
@@ -178,14 +178,14 @@
loggingLevel="INFO"
message="Endpoint to create operational policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
<toD
- uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
+ uri="http4://policyhost:8085?mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy created successfully','INFO',${header.LoopObject})" />
<to uri="direct:reset-raise-http-exception-flag" />
</route>
<route id="delete-operational-policy">
<from uri="direct:delete-operational-policy" />
- <to uri="direct:check-raise-http-exception-flag" />
+
<log
loggingLevel="INFO"
message="Deleting Operational Policy: ${header.operationalPolicy.getName()}" />
@@ -203,7 +203,7 @@
loggingLevel="INFO"
message="Endpoint to delete operational policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
<toD
- uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
+ uri="http4://policyhost:8085?mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy deleted successfully','INFO',${header.LoopObject})" />
<to uri="direct:reset-raise-http-exception-flag" />
@@ -211,7 +211,7 @@
<route id="create-guard-policy">
<from uri="direct:create-guard-policy" />
- <to uri="direct:check-raise-http-exception-flag" />
+
<log
loggingLevel="INFO"
message="Creating Guard Policy: ${header.guardPolicy.getKey()}" />
@@ -233,14 +233,14 @@
loggingLevel="INFO"
message="Endpoint to create guard policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
<toD
- uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
+ uri="http4://policyhost:8085?mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy created successfully','INFO',${header.LoopObject})" />
<to uri="direct:reset-raise-http-exception-flag" />
</route>
<route id="delete-guard-policy">
<from uri="direct:delete-guard-policy" />
- <to uri="direct:check-raise-http-exception-flag" />
+
<log
loggingLevel="INFO"
message="Deleting Guard Policy: ${header.guardPolicy.getKey()}" />
@@ -265,7 +265,7 @@
</route>
<route id="add-all-to-active-pdp-group">
<from uri="direct:add-all-to-active-pdp-group" />
- <to uri="direct:check-raise-http-exception-flag" />
+
<log
loggingLevel="INFO"
message="Adding loop policies to PDP Group: ${header.LoopObject.getName()}" />
@@ -287,7 +287,7 @@
loggingLevel="INFO"
message="Endpoint to add policies to PDP Group: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
<toD
- uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
+ uri="http4://policyhost:8085?mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Policies pushed to PDP Group successfully','INFO',${header.LoopObject})" />
<to uri="direct:reset-raise-http-exception-flag" />
@@ -295,7 +295,6 @@
<route id="remove-all-policy-from-active-pdp-group">
<from uri="direct:remove-all-policy-from-active-pdp-group" />
- <to uri="direct:check-raise-http-exception-flag" />
<log
loggingLevel="INFO"
message="Removing policies from active PDP group for loop: ${header.LoopObject.getName()}" />
@@ -318,27 +317,17 @@
loggingLevel="INFO"
message="Endpoint to delete policy from PDP Group: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log>
<toD
- uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
+ uri="http4://policyhost:8085?mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;authPassword={{clamp.config.policy.password}}" />
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog(${header.PolicyName}' Policy removed from PDP Group successfully','INFO',${header.LoopObject})" />
</split>
<to uri="direct:reset-raise-http-exception-flag" />
</route>
- <route id="check-raise-http-exception-flag">
- <from uri="direct:check-raise-http-exception-flag" />
- <when>
- <simple>${header.RaiseHttpExceptionFlag} == null</simple>
- <setHeader headerName="RaiseHttpExceptionFlag">
- <simple resultType="java.lang.Boolean">true</simple>
- </setHeader>
- </when>
- </route>
-
<route id="reset-raise-http-exception-flag">
<from uri="direct:reset-raise-http-exception-flag" />
- <setHeader headerName="RaiseHttpExceptionFlag">
- <constant>null</constant>
- </setHeader>
+ <setHeader headerName="RaiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setHeader>
</route>
</routes> \ No newline at end of file