diff options
Diffstat (limited to 'src/main/resources/clds/camel/routes/flexible-flow.xml')
-rw-r--r-- | src/main/resources/clds/camel/routes/flexible-flow.xml | 55 |
1 files changed, 41 insertions, 14 deletions
diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml index 33419c21..1f3e01e2 100644 --- a/src/main/resources/clds/camel/routes/flexible-flow.xml +++ b/src/main/resources/clds/camel/routes/flexible-flow.xml @@ -113,14 +113,14 @@ <constant>application/json</constant> </setHeader> <setHeader headerName="CamelHttpUri"> - <simple>{{clamp.config.policy.url}}/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies + <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies </simple> </setHeader> <log loggingLevel="INFO" message="Endpoint to create microservice policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> <toD - uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}" /> + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy created successfully','INFO',${header.LoopObject})" /> </route> @@ -136,14 +136,14 @@ <constant>DELETE</constant> </setHeader> <setHeader headerName="CamelHttpUri"> - <simple>{{clamp.config.policy.url}}/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies/${header.microServicePolicy.getName()} + <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies/${header.microServicePolicy.getName()} </simple> </setHeader> <log loggingLevel="INFO" message="Endpoint to delete microservice policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> <toD - uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('MicroService policy deleted successfully','INFO',${header.LoopObject})" /> </route> @@ -161,17 +161,17 @@ <constant>POST</constant> </setHeader> <setHeader headerName="Content-Type"> - <constant>application/json</constant> + <constant>application/yaml; legacy-version</constant> </setHeader> <setHeader headerName="CamelHttpUri"> - <simple>{{clamp.config.policy.url}}/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies + <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies </simple> </setHeader> <log loggingLevel="INFO" message="Endpoint to create operational policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> <toD - uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}" /> + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy created successfully','INFO',${header.LoopObject})" /> </route> @@ -187,14 +187,14 @@ <constant>DELETE</constant> </setHeader> <setHeader headerName="CamelHttpUri"> - <simple>{{clamp.config.policy.url}}/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies/${header.operationalPolicy.getName()} + <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies/${header.operationalPolicy.getName()} </simple> </setHeader> <log loggingLevel="INFO" message="Endpoint to delete operational policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> <toD - uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational policy deleted successfully','INFO',${header.LoopObject})" /> </route> @@ -215,14 +215,14 @@ <constant>application/json</constant> </setHeader> <setHeader headerName="CamelHttpUri"> - <simple>{{clamp.config.policy.url}}/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies + <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies </simple> </setHeader> <log loggingLevel="INFO" message="Endpoint to create guard policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> <toD - uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}" /> + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy created successfully','INFO',${header.LoopObject})" /> </route> @@ -238,16 +238,43 @@ <constant>DELETE</constant> </setHeader> <setHeader headerName="CamelHttpUri"> - <simple>{{clamp.config.policy.url}}/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${header.guardPolicy.getKey()} + <simple>{{clamp.config.policy.url}}/policy/api/v1/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${header.guardPolicy.getKey()} </simple> </setHeader> <log loggingLevel="INFO" message="Endpoint to delete guard policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> <toD - uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> <to uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Guard policy deleted successfully','INFO',${header.LoopObject})" /> </route> - + + <route id="create-pdp-group-policy"> + <from uri="direct:create-pdp-group-policy" /> + <log + loggingLevel="INFO" + message="Creating PDP Group Policy: ${header.guardPolicy.getKey()}" /> + <setBody> + <simple>${header.LoopObject.createPoliciesPayloadPdpGroup()} + </simple> + </setBody> + <setHeader headerName="CamelHttpMethod"> + <constant>POST</constant> + </setHeader> + <setHeader headerName="Content-Type"> + <constant>application/json</constant> + </setHeader> + <setHeader headerName="CamelHttpUri"> + <simple>{{clamp.config.policy.url}}/policy/pap/v1/pdps + </simple> + </setHeader> + <log + loggingLevel="INFO" + message="Endpoint to create PDP Group policy: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> + <toD + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&httpClient.connectTimeout=10000&authUsername={{clamp.config.policy.userName}}&authPassword={{clamp.config.policy.password}}" /> + <to + uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Pdp Group created successfully','INFO',${header.LoopObject})" /> + </route> </routes>
\ No newline at end of file |