aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/resources/clds
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources/clds')
-rw-r--r--src/main/resources/clds/camel/rest/clamp-api-v2.xml25
-rw-r--r--src/main/resources/clds/camel/routes/policy-flows.xml8
2 files changed, 18 insertions, 15 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 01ad8a8a3..7de2de1c9 100644
--- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -500,7 +500,7 @@
<simple resultType="java.lang.Boolean">false</simple>
</setProperty>
<to uri="direct:delete-policy-from-loop-object"/>
- <to uri="direct:create-policy"/>
+ <to uri="direct:create-policy-from-loop-object"/>
</split>
<log loggingLevel="INFO"
message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}"/>
@@ -517,7 +517,7 @@
</setProperty>
<to uri="direct:delete-policy-from-loop-object"/>
- <to uri="direct:create-policy"/>
+ <to uri="direct:create-policy-from-loop-object"/>
</split>
<delay>
@@ -1363,32 +1363,35 @@
</get>
<!-- Create a new policy -->
- <post uri="/v2/policies/{policyModelName}/{policyModelVersion}"
+ <post uri="/v2/policies/{policyModelType}/{policyModelVersion}/{policyName}/{policyVersion}"
type="com.google.gson.JsonElement"
consumes="application/json"
outType="com.google.gson.JsonObject"
produces="application/json">
<route>
<removeHeaders pattern="*"
- excludePattern="policyModelName|policyModelVersion"/>
+ excludePattern="policyModelType|policyModelVersion|policyName|policyVersion"/>
<doTry>
<to
uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*, 'CREATE a new Policy ')"/>
<to
uri="bean:org.onap.policy.clamp.authorization.AuthorizationController?method=authorize(*,'policies','','update')"/>
- <setProperty propertyName="policyModelName">
- <simple>${header.policyModelName}</simple>
+ <setProperty propertyName="policyModelType">
+ <simple>${header.policyModelType}</simple>
</setProperty>
<setProperty propertyName="policyModelVersion">
<simple>${header.policyModelVersion}</simple>
</setProperty>
+ <setProperty propertyName="policyProperties">
+ <simple>${body}</simple>
+ </setProperty>
+ <to
+ uri="bean:org.onap.policy.clamp.loop.template.PolicyModelsService?method=getPolicyModelTosca(${header.policyModelType},${header.policyModelVersion})"/>
<setBody>
- <method ref="org.onap.policy.clamp.policy.pdpgroup.PoliciesPdpMerger"
- method="removePdpStatesOnePolicy(${body})"/>
+ <method ref="org.onap.policy.clamp.policy.PolicyPayload"
+ method="createPolicyPayload(${header.policyModelType}, ${header.policyModelVersion},
+ ${header.policyName}, ${header.policyVersion}, ${exchangeProperty[policyProperties]}, ${body})"/>
</setBody>
- <setBody>
- <simple>${body.toString()}</simple>
- </setBody>
<to uri="direct:create-policy"/>
<to
uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()"/>
diff --git a/src/main/resources/clds/camel/routes/policy-flows.xml b/src/main/resources/clds/camel/routes/policy-flows.xml
index f9f2b1d72..c92617856 100644
--- a/src/main/resources/clds/camel/routes/policy-flows.xml
+++ b/src/main/resources/clds/camel/routes/policy-flows.xml
@@ -183,7 +183,7 @@
<simple>${exchangeProperty[policy].getPolicyModel().getPolicyModelType()}</simple>
</setProperty>
<setProperty propertyName="policyModelVersion">
- <simple>${exchangeProperty[policy].getPolicyModel().getVersion()</simple>
+ <simple>${exchangeProperty[policy].getPolicyModel().getVersion()}</simple>
</setProperty>
<setProperty propertyName="policyName">
<simple>${exchangeProperty[policy].getName()}</simple>
@@ -386,7 +386,7 @@
<from uri="direct:get-policy-tosca-model"/>
<doTry>
<log loggingLevel="INFO"
- message="Getting the policy tosca model: ${exchangeProperty[policyModelName]}/${exchangeProperty[policyModelVersion]}"/>
+ message="Getting the policy tosca model: ${exchangeProperty[policyModelType]}/${exchangeProperty[policyModelVersion]}"/>
<to
uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Getting the policy model')"/>
<setHeader headerName="CamelHttpMethod">
@@ -405,9 +405,9 @@
</simple>
</setHeader>
<log loggingLevel="INFO"
- message="Endpoint to get policy model: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyModelName]}/versions/${exchangeProperty[policyModelVersion]}"></log>
+ message="Endpoint to get policy model: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyModelType]}/versions/${exchangeProperty[policyModelVersion]}"></log>
<toD
- uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyModelName]}/versions/${exchangeProperty[policyModelVersion]}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
+ uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyModelType]}/versions/${exchangeProperty[policyModelVersion]}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
<convertBodyTo type="java.lang.String"/>
<doFinally>
<to uri="direct:reset-raise-http-exception-flag"/>