From 3854d7c1008aa947e4b532bbef9d9efc738f6928 Mon Sep 17 00:00:00 2001 From: sebdet Date: Wed, 15 Apr 2020 00:43:20 +0200 Subject: Fix legacy policy submit issues Operational legacy policy does not support semantic versionin for get status and delete policies, it has to be changed to integer Issue-ID: CLAMP-820 Signed-off-by: sebdet Change-Id: I78ff69b7502900d96fcc605fe997dd564dfa3e98 --- .../resources/clds/camel/routes/loop-flows.xml | 23 +- .../resources/clds/camel/routes/policy-flows.xml | 322 ++++----------------- 2 files changed, 84 insertions(+), 261 deletions(-) (limited to 'src/main/resources/clds') diff --git a/src/main/resources/clds/camel/routes/loop-flows.xml b/src/main/resources/clds/camel/routes/loop-flows.xml index 8c22743a3..2f4d9c8cf 100644 --- a/src/main/resources/clds/camel/routes/loop-flows.xml +++ b/src/main/resources/clds/camel/routes/loop-flows.xml @@ -40,6 +40,9 @@ ${body.getPolicyModel().getPolicyModelType()} + + ${body.getPolicyModel().getVersion()} + 1.0.0 @@ -61,9 +64,22 @@ ${body.getPolicyModel().getPolicyModelType()} - - 1.0.0 + + ${body.getPolicyModel().getVersion()} + + + ${body.isLegacy()} == true + + 1 + + + + + 1.0.0 + + + ${body} @@ -84,6 +100,9 @@ onap.policies.controlloop.Guard + + 1.0.0 + 1 diff --git a/src/main/resources/clds/camel/routes/policy-flows.xml b/src/main/resources/clds/camel/routes/policy-flows.xml index 80926722f..a61bc67fb 100644 --- a/src/main/resources/clds/camel/routes/policy-flows.xml +++ b/src/main/resources/clds/camel/routes/policy-flows.xml @@ -54,9 +54,9 @@ + message="Endpoint to get policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyType]}/versions/${exchangeProperty[policyTypeVersion]}/policies/${exchangeProperty[policyName]}/versions/${exchangeProperty[policyVersion]}"> + uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyType]}/versions/${exchangeProperty[policyTypeVersion]}/policies/${exchangeProperty[policyName]}/versions/${exchangeProperty[policyVersion]}?bridgeEndpoint=true&useSystemProperties=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&authMethod=Basic&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> ${exchangeProperty[X-ONAP-PartnerName]} + + + ${body.isLegacy()} == true + + 1 + + + + + 1.0.0 + + + + message="Endpoint to delete policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policy].getPolicyModel().getPolicyModelType()}/versions/${exchangeProperty[policy].getPolicyModel().getVersion()}/policies/${exchangeProperty[policy].getName()}/versions/${exchangeProperty[policyVersion]}"> + uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policy].getPolicyModel().getPolicyModelType()}/versions/${exchangeProperty[policy].getPolicyModel().getVersion()}/policies/${exchangeProperty[policy].getName()}/versions/${exchangeProperty[policyVersion]}?bridgeEndpoint=true&useSystemProperties=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.api.userName}}&authPassword={{clamp.config.policy.api.password}}&connectionTimeToLive=5000&httpClient.connectTimeout=10000&httpClient.socketTimeout=20000&authenticationPreemptive=true&connectionClose=true"/> @@ -279,199 +292,6 @@ - - - - - - - ${exchangeProperty[microServicePolicy].createPolicyPayload()} - - - - POST - - - application/json - - - ${exchangeProperty[X-ONAP-RequestID]} - - - - ${exchangeProperty[X-ONAP-InvocationID]} - - - - ${exchangeProperty[X-ONAP-PartnerName]} - - - - - - - - - ${exchangeProperty[microServicePolicy].getName()} creation - status - - - - POLICY - - - - - - - - - - - - - null - - - DELETE - - - ${exchangeProperty[X-ONAP-RequestID]} - - - - ${exchangeProperty[X-ONAP-InvocationID]} - - - - ${exchangeProperty[X-ONAP-PartnerName]} - - - - - - - - - - ${exchangeProperty[microServicePolicy].getName()} removal - status - - - - POLICY - - - - - - - - - - - - - ${exchangeProperty[operationalPolicy].createPolicyPayload()} - - - - POST - - - application/json - - - ${exchangeProperty[X-ONAP-RequestID]} - - - - ${exchangeProperty[X-ONAP-InvocationID]} - - - - ${exchangeProperty[X-ONAP-PartnerName]} - - - - - - - - - ${exchangeProperty[operationalPolicy].getName()} creation - status - - - - POLICY - - - - - - - - - - - - - null - - - DELETE - - - ${exchangeProperty[X-ONAP-RequestID]} - - - - ${exchangeProperty[X-ONAP-InvocationID]} - - - - ${exchangeProperty[X-ONAP-PartnerName]} - - - - - - - - - ${exchangeProperty[operationalPolicy].getName()} removal - status - - - - POLICY - - - - - - @@ -575,7 +395,7 @@ - ${exchangeProperty[loopObject].getComponent("POLICY").createPoliciesPayloadPdpGroup(exchangeProperty[loopObject])} + ${exchangeProperty[loopObject].getComponent("POLICY").createPoliciesPayloadPdpGroup(exchangeProperty[loopObject],"POST")} @@ -618,67 +438,51 @@ - - - - - ${exchangeProperty[loopObject].getComponent("POLICY").listPolicyNamesPdpGroup(exchangeProperty[loopObject])} - - - ${body} - - - null - - - DELETE - - - ${exchangeProperty[X-ONAP-RequestID]} - - - - ${exchangeProperty[X-ONAP-InvocationID]} - - - - ${exchangeProperty[X-ONAP-PartnerName]} - - - - - - ${exchangeProperty[policyName]} PDP Group removal status - - - - POLICY - - - - - java.lang.Exception - - false - - - PDP Group removal, Error reported: ${exception} - - - POLICY - - - - - - - - + + + + + ${exchangeProperty[loopObject].getComponent("POLICY").createPoliciesPayloadPdpGroup(exchangeProperty[loopObject],"DELETE")} + + + + POST + + + application/json + + + ${exchangeProperty[X-ONAP-RequestID]} + + + + ${exchangeProperty[X-ONAP-InvocationID]} + + + + ${exchangeProperty[X-ONAP-PartnerName]} + + + + + + + + + + PDP Group remove ALL status + + + POLICY + + + + -- cgit 1.2.3-korg