aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/resources
diff options
context:
space:
mode:
authorEddy Hautot <eh552t@intl.att.com>2019-04-10 15:57:33 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-10 15:57:33 +0000
commite4e7c6a19dd50516247ad33dbe2a868b7825ea10 (patch)
treecb2d387e03c42bc75afb270a1cf4a7a09d76ae17 /src/main/resources
parenta98577e6a0a6fed54afebeb08c4de7c9215e49bb (diff)
parentece804b26d14786cc382dedc5a955f0f36b54029 (diff)
Merge changes I8c744a32,Id357ac37,I7df87e14,I2abd173c,Ie53b1dfd
* changes: Add timeout + Creds Remove SQL Dump Add delete support Rework Gson in Camel PDP Group support
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/META-INF/services/org/apache/camel/dataformat/clamp-gson23
-rw-r--r--src/main/resources/application-noaaf.properties4
-rw-r--r--src/main/resources/application.properties4
-rw-r--r--src/main/resources/clds/camel/rest/clamp-api-v2.xml98
-rw-r--r--src/main/resources/clds/camel/routes/flexible-flow.xml55
5 files changed, 151 insertions, 33 deletions
diff --git a/src/main/resources/META-INF/services/org/apache/camel/dataformat/clamp-gson b/src/main/resources/META-INF/services/org/apache/camel/dataformat/clamp-gson
new file mode 100644
index 000000000..3fa78e040
--- /dev/null
+++ b/src/main/resources/META-INF/services/org/apache/camel/dataformat/clamp-gson
@@ -0,0 +1,23 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights
+ * reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ */
+
+class=org.onap.clamp.configuration.ClampGsonDataFormat \ No newline at end of file
diff --git a/src/main/resources/application-noaaf.properties b/src/main/resources/application-noaaf.properties
index 84e97ea30..56ad7e846 100644
--- a/src/main/resources/application-noaaf.properties
+++ b/src/main/resources/application-noaaf.properties
@@ -110,7 +110,7 @@ spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.use-new-id-generator-mappings=true
# Whether to enable logging of SQL statements.
-spring.jpa.show-sql=true
+#spring.jpa.show-sql=true
#Async Executor default Parameters
async.core.pool.size=10
@@ -135,7 +135,7 @@ clamp.config.dcae.deployment.template=classpath:/clds/templates/dcae-deployment-
#
#
# Configuration Settings for Policy Engine Components
-clamp.config.policy.url=http://policy.api.simpledemo.onap.org:8081/policy/api/v1
+clamp.config.policy.url=http://policy.api.simpledemo.onap.org:8081
clamp.config.policy.userName=test
clamp.config.policy.password=test
clamp.config.policy.pdpUrl1=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index b1077d382..640120230 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -125,7 +125,7 @@ spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.use-new-id-generator-mappings=true
# Whether to enable logging of SQL statements.
-spring.jpa.show-sql=true
+#spring.jpa.show-sql=true
#Async Executor default Parameters
async.core.pool.size=10
@@ -150,7 +150,7 @@ clamp.config.dcae.deployment.template=classpath:/clds/templates/dcae-deployment-
#
#
# Configuration Settings for Policy Engine Components
-clamp.config.policy.url=http://policy.api.simpledemo.onap.org:8081/policy/api/v1
+clamp.config.policy.url=http://policy.api.simpledemo.onap.org:8081
clamp.config.policy.userName=test
clamp.config.policy.password=test
clamp.config.policy.pdpUrl1=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
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 810c9d205..ffa4719f0 100644
--- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -97,14 +97,14 @@
</put>
<put uri="/v2/loop/submit/{loopName}">
<route>
- <setBody>
- <simple>${header.loopName}</simple>
- </setBody>
<log
loggingLevel="INFO"
- message="Receive SUBMIT request for loop: ${body}" />
+ message="Receive SUBMIT request for loop: ${header.loopName}" />
<to
uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+ <setBody>
+ <simple>${header.loopName}</simple>
+ </setBody>
<to uri="direct:load-loop" />
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive SUBMIT request','INFO',${header.LoopObject})" />
@@ -120,12 +120,12 @@
<log
loggingLevel="INFO"
message="Processing Micro Service Policy: ${header.microServicePolicy.getName()}" />
- <setHeader headerName="HttpQueryExceptionFlag">
+ <setHeader headerName="RaiseHttpExceptionFlag">
<simple resultType="java.lang.Boolean">false</simple>
</setHeader>
<to uri="direct:delete-micro-service-policy" />
- <setHeader headerName="HttpQueryExceptionFlag">
+ <setHeader headerName="RaiseHttpExceptionFlag">
<simple resultType="java.lang.Boolean">true</simple>
</setHeader>
<to uri="direct:create-micro-service-policy" />
@@ -143,12 +143,12 @@
<log
loggingLevel="INFO"
message="Processing Operational Policy: ${header.operationalPolicy.getName()}" />
- <setHeader headerName="HttpQueryExceptionFlag">
+ <setHeader headerName="RaiseHttpExceptionFlag">
<simple resultType="java.lang.Boolean">false</simple>
</setHeader>
<to uri="direct:delete-operational-policy" />
- <setHeader headerName="HttpQueryExceptionFlag">
+ <setHeader headerName="RaiseHttpExceptionFlag">
<simple resultType="java.lang.Boolean">true</simple>
</setHeader>
<to uri="direct:create-operational-policy" />
@@ -165,30 +165,98 @@
loggingLevel="INFO"
message="Processing Guard Policy: ${header.guardPolicy.getKey()}" />
- <setHeader headerName="HttpQueryExceptionFlag">
+ <setHeader headerName="RaiseHttpExceptionFlag">
<simple resultType="java.lang.Boolean">false</simple>
</setHeader>
<to uri="direct:delete-guard-policy" />
- <setHeader headerName="HttpQueryExceptionFlag">
+ <setHeader headerName="RaiseHttpExceptionFlag">
<simple resultType="java.lang.Boolean">true</simple>
</setHeader>
<to uri="direct:create-guard-policy" />
</split>
-
</split>
+ <setHeader headerName="RaiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setHeader>
+ <to uri="direct:create-pdp-group-policy" />
+
+ <log
+ loggingLevel="INFO"
+ message="SUBMIT request successfully executed for loop: ${body}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${header.LoopObject})" />
</route>
</put>
<put uri="/v2/loop/delete/{loopName}">
<route>
+ <log
+ loggingLevel="INFO"
+ message="Receive DELETE request for loop: ${header.loopName}" />
<to
uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+ <setBody>
+ <simple>${header.loopName}</simple>
+ </setBody>
+ <to uri="direct:load-loop" />
<to
- uri="bean:org.onap.clamp.operation.LoopOperation?method=deleteMsPolicies(${header.loopName})" />
- <to
- uri="bean:org.onap.clamp.operation.LoopOperation?method=deleteOpPolicy(${header.loopName})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive DELETE request','INFO',${header.LoopObject})" />
+ <split>
+ <simple>${header.LoopObject.getMicroServicePolicies()}
+ </simple>
+ <setHeader headerName="microServicePolicy">
+ <simple>${body}</simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Processing Micro Service Policy: ${header.microServicePolicy.getName()}" />
+ <setHeader headerName="RaiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setHeader>
+ <to uri="direct:delete-micro-service-policy" />
+ </split>
+
+ <log
+ loggingLevel="INFO"
+ message="Processing all OPERATIONAL policies defined in loop ${header.LoopObject.getName()}" />
+ <split>
+ <simple>${header.LoopObject.getOperationalPolicies()}
+ </simple>
+ <setHeader headerName="operationalPolicy">
+ <simple>${body}</simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Processing Operational Policy: ${header.operationalPolicy.getName()}" />
+ <setHeader headerName="RaiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setHeader>
+ <to uri="direct:delete-operational-policy" />
+ <log
+ loggingLevel="INFO"
+ message="Processing all GUARD policies defined in loop ${header.LoopObject.getName()}" />
+ <split>
+ <simple>${header.operationalPolicy.createGuardPolicyPayloads().entrySet()}
+ </simple>
+ <setHeader headerName="guardPolicy">
+ <simple>${body}</simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Processing Guard Policy: ${header.guardPolicy.getKey()}" />
+
+ <setHeader headerName="RaiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setHeader>
+ <to uri="direct:delete-guard-policy" />
+ </split>
+ </split>
+ <to uri="bean:org.onap.clamp.loop.log.LoopService?method=deleteLoop(${header.loopName})" />
+ <log
+ loggingLevel="INFO"
+ message="DELETE request successfully executed for loop: ${body}" />
<to
- uri="bean:org.onap.clamp.operation.LoopOperation?method=deleteGuardPolicy(${header.loopName})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request successfully executed','INFO',${header.LoopObject})" />
</route>
</put>
</rest>
diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml
index 33419c219..1f3e01e27 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}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;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}&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false" />
+ uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.userName}}&amp;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}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;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}&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false" />
+ uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.userName}}&amp;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}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;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}&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false" />
+ uri="http4://policyhost:8085?throwExceptionOnFailure=${header.RaiseHttpExceptionFlag}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.userName}}&amp;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}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.userName}}&amp;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