summaryrefslogtreecommitdiffstats
path: root/src/main/resources
diff options
context:
space:
mode:
authorS�bastien Determe <sebastien.determe@intl.att.com>2021-04-02 08:59:06 +0000
committerGerrit Code Review <gerrit@onap.org>2021-04-02 08:59:06 +0000
commitdf451dc64de36d571efb4f0457a83bc94e8f3969 (patch)
tree71320c72b3a43199ffa28750fb96c25bbd19171b /src/main/resources
parentb814a52eef4a28b5440638bdd1fc0b9fb58db467 (diff)
parentee233569e74e4620cb35ce4e9c4320b30d108824 (diff)
Merge "Rework the backend to support PDP updates"
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/clds/camel/rest/clamp-api-v2.xml4
-rw-r--r--src/main/resources/clds/camel/routes/policy-flows.xml67
2 files changed, 42 insertions, 29 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 7de2de1c9..de0bb1ab0 100644
--- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -437,7 +437,7 @@
<to
uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('RESTART request','INFO',${exchangeProperty[loopObject]})"/>
- <to uri="direct:add-all-to-active-pdp-group"/>
+ <to uri="direct:add-policies-from-loop-to-pdp-group"/>
<log loggingLevel="INFO"
message="RESTART request successfully executed for loop: ${header.loopName}"/>
<to
@@ -524,7 +524,7 @@
<constant>3000</constant>
</delay>
- <to uri="direct:add-all-to-active-pdp-group"/>
+ <to uri="direct:add-policies-from-loop-to-pdp-group"/>
<log loggingLevel="INFO"
message="SUBMIT request successfully executed for loop: ${header.loopName}"/>
diff --git a/src/main/resources/clds/camel/routes/policy-flows.xml b/src/main/resources/clds/camel/routes/policy-flows.xml
index c92617856..cc51a086e 100644
--- a/src/main/resources/clds/camel/routes/policy-flows.xml
+++ b/src/main/resources/clds/camel/routes/policy-flows.xml
@@ -208,8 +208,8 @@
</doTry>
</route>
- <route id="add-all-to-active-pdp-group">
- <from uri="direct:add-all-to-active-pdp-group"/>
+ <route id="add-policies-from-loop-to-pdp-group">
+ <from uri="direct:add-policies-from-loop-to-pdp-group"/>
<doTry>
<log loggingLevel="INFO"
message="Adding loop policies to PDP Group: ${exchangeProperty[loopObject].getName()}"/>
@@ -220,31 +220,8 @@
${exchangeProperty[loopObject].getComponent("POLICY").createPoliciesPayloadPdpGroup(exchangeProperty[loopObject],"POST")}
</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/deployments/batch"></log>
- <toD
- uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/deployments/batch?bridgeEndpoint=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;useSystemProperties=true&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
-
+ <to uri="direct:add-multiple-policies-to-pdp-group"/>
<doFinally>
- <to uri="direct:reset-raise-http-exception-flag"/>
<to
uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
<setProperty propertyName="logMessage">
@@ -486,7 +463,43 @@
</doFinally>
</doTry>
</route>
-
+ <route id="add-multiple-policies-to-pdp-group">
+ <from uri="direct:add-multiple-policies-to-pdp-group"/>
+ <!-- Body should come from outside, expect a json describing the policy -->
+ <doTry>
+ <log loggingLevel="INFO"
+ message="Add policies to PDP group"/>
+ <to
+ uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Add policies to PDP group')"/>
+ <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/deployments/batch"></log>
+ <toD
+ uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/deployments/batch?bridgeEndpoint=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;useSystemProperties=true&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}&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.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
+ </doFinally>
+ </doTry>
+ </route>
<route id="undeploy-one-policy-from-pap">
<from uri="direct:undeploy-one-policy-from-pap"/>
<doTry>