From 338c218458d6a671dd754ee5c151517685376bd9 Mon Sep 17 00:00:00 2001 From: sebdet Date: Thu, 25 Apr 2019 12:33:31 +0200 Subject: Fix policy calls Fix policy calls so that the url is now right + update camel version to latest Issue-ID: CLAMP-357 Change-Id: Iffc83f53eb2361d7551b43b28c8e822fbf38c619 Signed-off-by: sebdet --- .../resources/clds/camel/rest/clamp-api-v2.xml | 572 +++++++++++---------- .../resources/clds/camel/routes/flexible-flow.xml | 213 ++++---- 2 files changed, 403 insertions(+), 382 deletions(-) (limited to 'src/main/resources/clds/camel') 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 6bd1132cc..bc1a07feb 100644 --- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -5,8 +5,9 @@ outType="java.lang.String[]" produces="application/json"> - - + + @@ -14,14 +15,15 @@ uri="bean:org.onap.clamp.loop.LoopController?method=getLoopNames()" /> - - java.lang.Exception - - false - - - - + + java.lang.Exception + + false + + + + + - @@ -38,14 +41,15 @@ uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" /> - - java.lang.Exception - - false - - - - + + java.lang.Exception + + false + + + + + - @@ -62,14 +67,15 @@ uri="bean:org.onap.clamp.loop.LoopController?method=getSVGRepresentation(${header.loopName})" /> - - java.lang.Exception - - false - - - - + + java.lang.Exception + + false + + + + @@ -80,8 +86,9 @@ outType="org.onap.clamp.loop.Loop" produces="application/json"> + - @@ -92,17 +99,18 @@ + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Global Properties UPDATED','INFO',${exchangeProperty[loopObject]})" /> - - java.lang.Exception - - false - - - - + + java.lang.Exception + + false + + + + + - @@ -124,17 +133,18 @@ + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational and Guard policies UPDATED','INFO',${exchangeProperty[loopObject]})" /> - - java.lang.Exception - - false - - - - + + java.lang.Exception + + false + + + + + - - + ${body} - + + uri="bean:org.onap.clamp.loop.LoopController?method=updateMicroservicePolicy(${header.loopName},${exchangeProperty[MicroServicePolicyObject]})" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Micro Service policies UPDATED','INFO',${exchangeProperty[loopObject]})" /> - - java.lang.Exception - - false - - - - + + java.lang.Exception + + false + + + + + - @@ -184,14 +197,15 @@ uri="bean:org.onap.clamp.operation.LoopOperation?method=deployLoop(*,${header.loopName})" /> - - java.lang.Exception - - false - - - - + + java.lang.Exception + + false + + + + + - @@ -208,14 +223,15 @@ uri="bean:org.onap.clamp.operation.LoopOperation?method=unDeployLoop(${header.loopName})" /> - - java.lang.Exception - - false - - - - + + java.lang.Exception + + false + + + + + - - + - java.lang.Exception - - false - - - + java.lang.Exception + + false + + + @@ -249,19 +267,20 @@ loggingLevel="INFO" message="STOP request successfully executed for loop: ${body}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${exchangeProperty[loopObject]})" /> - - java.lang.Exception - - false - - - - + + java.lang.Exception + + false + + + + + - - - + + - java.lang.Exception - - false - - - + java.lang.Exception + + false + + + + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request successfully executed','INFO',${exchangeProperty[loopObject]})" /> - - java.lang.Exception - - false - - - - + + java.lang.Exception + + false + + + + + - + - + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive SUBMIT request','INFO',${exchangeProperty[loopObject]})" /> + false - - - + + + - java.lang.Exception - - false - - - + java.lang.Exception + + false + + + + message="Processing all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}" /> - ${header.LoopObject.getMicroServicePolicies()} + ${exchangeProperty[loopObject].getMicroServicePolicies()} - + ${body} - + - + message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" /> + false - + - + - java.lang.Exception - - false - - - + java.lang.Exception + + false + + + - + - java.lang.Exception - - false - - - + java.lang.Exception + + false + + + - + + message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" /> - ${header.LoopObject.getOperationalPolicies()} + ${exchangeProperty[loopObject].getOperationalPolicies()} - + ${body} - + - + message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" /> + false - + - + - java.lang.Exception - - false - - - + java.lang.Exception + + false + + + - + - java.lang.Exception - - false - - - + java.lang.Exception + + false + + + - + + message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" /> - ${header.operationalPolicy.createGuardPolicyPayloads().entrySet()} + ${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()} - + ${body} - + + message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" /> - + false - - - + + + - java.lang.Exception - - false - - - + java.lang.Exception + + false + + + - + - java.lang.Exception - - false - - - + java.lang.Exception + + false + + + - - - + + + - java.lang.Exception - - false - - - + java.lang.Exception + + false + + + - + + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" /> - - java.lang.Exception - - false - - - - + + java.lang.Exception + + false + + + + + - + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive DELETE request','INFO',${exchangeProperty[loopObject]})" /> - + - java.lang.Exception - - false - - - + java.lang.Exception + + false + + + - + - ${header.LoopObject.getMicroServicePolicies()} + ${exchangeProperty[loopObject].getMicroServicePolicies()} - + ${body} - + + message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" /> - + - java.lang.Exception - - false - - - + java.lang.Exception + + false + + + + message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" /> - ${header.LoopObject.getOperationalPolicies()} + ${exchangeProperty[loopObject].getOperationalPolicies()} - + ${body} - + - - + message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" /> + + - java.lang.Exception - - false - - - + java.lang.Exception + + false + + + + message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" /> - ${header.operationalPolicy.createGuardPolicyPayloads().entrySet()} + ${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()} - + ${body} - + + message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" /> - + - java.lang.Exception - - false - - - + java.lang.Exception + + false + + + @@ -598,17 +635,18 @@ loggingLevel="INFO" message="DELETE request successfully executed for loop: ${body}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request successfully executed','INFO',${exchangeProperty[loopObject]})" /> - - java.lang.Exception - - false - - - - + + java.lang.Exception + + false + + + + diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml index 808e1d8a1..224502056 100644 --- a/src/main/resources/clds/camel/routes/flexible-flow.xml +++ b/src/main/resources/clds/camel/routes/flexible-flow.xml @@ -81,14 +81,14 @@ ${header.loopName} - + - + - ${header.LoopObject} == null + ${exchangeProperty[loopObject]} == null 404 @@ -98,16 +98,17 @@ + - + + message="Creating Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" /> - ${header.microServicePolicy.createPolicyPayload()} + ${exchangeProperty[microServicePolicy].createPolicyPayload()} @@ -116,38 +117,36 @@ application/json - - {{clamp.config.policy.url}}/policy/api/v1/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies - - - ${header.X-ONAP-REAUESTID} + ${exchangeProperty[X-ONAP-RequestID]} - ${header.X-ONAP-InvocationID} + ${exchangeProperty[X-ONAP-InvocationID]} - ${header.X-ONAP-PartnerName} + ${exchangeProperty[X-ONAP-PartnerName]} + message="Endpoint to create microservice policy: {{clamp.config.policy.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies"> + uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy created successfully','INFO',${exchangeProperty[loopObject]})" /> - + + - + + message="Deleting Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" /> @@ -156,43 +155,40 @@ DELETE - - {{clamp.config.policy.url}}/policy/api/v1/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies/${header.microServicePolicy.getName()} - - - ${header.X-ONAP-REAUESTID} + ${exchangeProperty[X-ONAP-RequestID]} - ${header.X-ONAP-InvocationID} + ${exchangeProperty[X-ONAP-InvocationID]} - ${header.X-ONAP-PartnerName} + ${exchangeProperty[X-ONAP-PartnerName]} + message="Endpoint to delete microservice policy: {{clamp.config.policy.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}"> + uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy deleted successfully','INFO',${exchangeProperty[loopObject]})" /> - + - + + message="Creating Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" /> - ${header.operationalPolicy.createPolicyPayload()} + ${exchangeProperty[operationalPolicy].createPolicyPayload()} @@ -201,38 +197,36 @@ application/yaml; legacy-version - - {{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies - - - ${header.X-ONAP-REAUESTID} + ${exchangeProperty[X-ONAP-RequestID]} - ${header.X-ONAP-InvocationID} + ${exchangeProperty[X-ONAP-InvocationID]} - ${header.X-ONAP-PartnerName} + ${exchangeProperty[X-ONAP-PartnerName]} + message="Endpoint to create operational policy: {{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policies.controlloop.operational/versions/1.0.0/policies"> + uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policies.controlloop.operational/versions/1.0.0/policies?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy created successfully','INFO',${exchangeProperty[loopObject]})" /> - + + - + + message="Deleting Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" /> @@ -241,43 +235,40 @@ DELETE - - {{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies/${header.operationalPolicy.getName()} - - - ${header.X-ONAP-REAUESTID} + ${exchangeProperty[X-ONAP-RequestID]} - ${header.X-ONAP-InvocationID} + ${exchangeProperty[X-ONAP-InvocationID]} - ${header.X-ONAP-PartnerName} + ${exchangeProperty[X-ONAP-PartnerName]} + message="Endpoint to delete operational policy: {{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policies.controlloop.operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}"> + uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policies.controlloop.operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy deleted successfully','INFO',${exchangeProperty[loopObject]})" /> - + - + + message="Creating Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" /> - ${header.guardPolicy.getValue()} + ${exchangeProperty[guardPolicy].getValue()} @@ -286,38 +277,36 @@ application/json - - {{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies - - - ${header.X-ONAP-REAUESTID} + ${exchangeProperty[X-ONAP-RequestID]} - ${header.X-ONAP-InvocationID} + ${exchangeProperty[X-ONAP-InvocationID]} - ${header.X-ONAP-PartnerName} + ${exchangeProperty[X-ONAP-PartnerName]} + message="Endpoint to create guard policy: {{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies"> + uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy created successfully','INFO',${exchangeProperty[loopObject]})" /> - + + - + + message="Deleting Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" /> @@ -326,42 +315,40 @@ DELETE - - {{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${header.guardPolicy.getKey()} - - - ${header.X-ONAP-REAUESTID} + ${exchangeProperty[X-ONAP-RequestID]} - ${header.X-ONAP-InvocationID} + ${exchangeProperty[X-ONAP-InvocationID]} - ${header.X-ONAP-PartnerName} + ${exchangeProperty[X-ONAP-PartnerName]} + message="Endpoint to delete guard policy: {{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}"> + uri="{{clamp.config.policy.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}?bridgeEndpoint=true&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy deleted successfully','INFO',${exchangeProperty[loopObject]})" /> - + + - + + message="Adding loop policies to PDP Group: ${exchangeProperty[loopObject].getName()}" /> - ${header.LoopObject.createPoliciesPayloadPdpGroup()} + ${exchangeProperty[loopObject].createPoliciesPayloadPdpGroup()} @@ -370,82 +357,78 @@ application/json - - {{clamp.config.policy.url}}/policy/pap/v1/pdps - - - ${header.X-ONAP-REAUESTID} + ${exchangeProperty[X-ONAP-RequestID]} - ${header.X-ONAP-InvocationID} + ${exchangeProperty[X-ONAP-InvocationID]} - ${header.X-ONAP-PartnerName} + ${exchangeProperty[X-ONAP-PartnerName]} + message="Endpoint to add policies to PDP Group: {{clamp.config.policy.url}}/policy/pap/v1/pdps"> + uri="{{clamp.config.policy.url}}/policy/pap/v1/pdps?throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authMethod=Basic&authUsername=test&authPassword=test" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Policies pushed to PDP Group successfully','INFO',${exchangeProperty[loopObject]})" /> - + + message="Removing policies from active PDP group for loop: ${exchangeProperty[loopObject].getName()}" /> - ${header.LoopObject.listPolicyNamesPdpGroup()} - + ${exchangeProperty[loopObject].listPolicyNamesPdpGroup()} + + ${body} - + null DELETE - - {{clamp.config.policy.url}}/pdps/policies/${header.PolicyName}/versions/1.0.0 - - - ${header.X-ONAP-REAUESTID} + ${exchangeProperty[X-ONAP-RequestID]} - ${header.X-ONAP-InvocationID} + ${exchangeProperty[X-ONAP-InvocationID]} - ${header.X-ONAP-PartnerName} + ${exchangeProperty[X-ONAP-PartnerName]} + message="Endpoint to delete policy from PDP Group: {{clamp.config.policy.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0"> + uri="{{clamp.config.policy.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0?bridgeEndpoint=true&mapHttpMessageHeaders=false&throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog(${exchangeProperty[policyName]}' Policy removed from PDP Group successfully','INFO',${exchangeProperty[loopObject]})" /> - + + - + true - + \ No newline at end of file -- cgit 1.2.3-korg