From d57ce70f4454210c4ed04476af564ca10bb66292 Mon Sep 17 00:00:00 2001 From: Jorge Hernandez Date: Tue, 19 Sep 2017 09:09:05 -0500 Subject: enhancements to archetype and apps packaging Change-Id: I3e659d35d3cb397c011657f39ef12b10b0564fc9 Issue-ID: POLICY-162 Signed-off-by: Jorge Hernandez --- controlloop/packages/apps/src/files/apps-installer | 32 +++++++++++++++ controlloop/packages/artifacts/pom.xml | 48 ++++++++++++++++++++++ .../packages/artifacts/src/assembly/zip.xml | 1 - .../src/main/resources/archetype-resources/pom.xml | 5 +++ .../config/__artifactId__-controller.properties | 24 +++++------ .../config/__artifactId__-controller.rest.json | 16 ++++---- .../main/resources/__closedLoopControlName__.drl | 27 +++++++++++- 7 files changed, 131 insertions(+), 22 deletions(-) create mode 100644 controlloop/packages/apps/src/files/apps-installer diff --git a/controlloop/packages/apps/src/files/apps-installer b/controlloop/packages/apps/src/files/apps-installer new file mode 100644 index 000000000..f6b27abcf --- /dev/null +++ b/controlloop/packages/apps/src/files/apps-installer @@ -0,0 +1,32 @@ +#!/bin/bash + +### +# ============LICENSE_START======================================================= +# Apps Installation Package +# ================================================================================ +# Copyright (C) 2017 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========================================================= +### + +# +# This file will be automatically invoked by the main pdp-d installer +# for drools applications +# + +echo "APPS INSTALL" + +# cache in local maven repo + +mvn dependency:get -Dartifact=com.att.research.xacml:xacml-pdp:1.0.0:jar diff --git a/controlloop/packages/artifacts/pom.xml b/controlloop/packages/artifacts/pom.xml index 486c55cb4..d8c0f570d 100644 --- a/controlloop/packages/artifacts/pom.xml +++ b/controlloop/packages/artifacts/pom.xml @@ -96,6 +96,12 @@ ${project.version} jar + + org.onap.policy.drools-applications + appclcm + ${project.version} + jar + org.onap.policy.drools-applications vfc @@ -114,6 +120,12 @@ ${project.version} jar + + org.onap.policy.drools-applications + sdc + ${project.version} + jar + org.onap.policy.drools-applications trafficgenerator @@ -132,6 +144,36 @@ ${project.version} jar + + org.onap.policy.drools-applications + actorServiceProvider + ${project.version} + jar + + + org.onap.policy.drools-applications + actor.appc + ${project.version} + jar + + + org.onap.policy.drools-applications + actor.appclcm + ${project.version} + jar + + + org.onap.policy.drools-applications + actor.so + ${project.version} + jar + + + org.onap.policy.drools-applications + actor.vfc + ${project.version} + jar + org.onap.policy.drools-applications policy-yaml @@ -150,5 +192,11 @@ ${project.version} jar + + com.att.research.xacml + xacml-pdp + 1.0.0 + jar + diff --git a/controlloop/packages/artifacts/src/assembly/zip.xml b/controlloop/packages/artifacts/src/assembly/zip.xml index e3f018d26..3c7c61973 100644 --- a/controlloop/packages/artifacts/src/assembly/zip.xml +++ b/controlloop/packages/artifacts/src/assembly/zip.xml @@ -27,7 +27,6 @@ artifacts - false diff --git a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/pom.xml b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/pom.xml index e0a967f3d..12d2b944c 100644 --- a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/pom.xml +++ b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/pom.xml @@ -128,6 +128,11 @@ policy-yaml ${dependenciesVersion} + + com.att.research.xacml + xacml-pdp + 1.0.0 + org.onap.policy.drools-pdp policy-management diff --git a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/config/__artifactId__-controller.properties b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/config/__artifactId__-controller.properties index ddc70d784..18daf6a50 100644 --- a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/config/__artifactId__-controller.properties +++ b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/config/__artifactId__-controller.properties @@ -33,22 +33,22 @@ ueb.source.topics.APPC-CL.servers=${dmaapServers} ueb.source.topics.APPC-CL.apiKey= ueb.source.topics.APPC-CL.apiSecret= ueb.source.topics.APPC-CL.events=org.onap.policy.appclcm.LCMResponseWrapper -ueb.source.topics.APPC-CL.events.org.onap.policy.appclcm.LCMResponseWrapper.filter=body\=.* +ueb.source.topics.APPC-CL.events.org.onap.policy.appclcm.LCMResponseWrapper.filter=type\=response ueb.source.topics.APPC-CL.events.custom.gson=org.onap.policy.appclcm.util.Serialization,gson -ueb.sink.topics=APPC-CL,POLICY-CL-MGT +noop.sink.topics=APPC-CL,POLICY-CL-MGT -ueb.sink.topics.APPC-CL.servers=${dmaapServers} -ueb.sink.topics.APPC-CL.apiKey= -ueb.sink.topics.APPC-CL.apiSecret= -ueb.sink.topics.APPC-CL.events=org.onap.policy.appclcm.LCMRequestWrapper -ueb.sink.topics.APPC-CL.events.custom.gson=org.onap.policy.appclcm.util.Serialization,gson +noop.sink.topics.APPC-CL.servers=${dmaapServers} +noop.sink.topics.APPC-CL.apiKey= +noop.sink.topics.APPC-CL.apiSecret= +noop.sink.topics.APPC-CL.events=org.onap.policy.appclcm.LCMRequestWrapper +noop.sink.topics.APPC-CL.events.custom.gson=org.onap.policy.appclcm.util.Serialization,gson -ueb.sink.topics.POLICY-CL-MGT.servers=${dmaapServers} -ueb.sink.topics.POLICY-CL-MGT.apiKey= -ueb.sink.topics.POLICY-CL-MGT.apiSecret= -ueb.sink.topics.POLICY-CL-MGT.events=org.onap.policy.controlloop.VirtualControlLoopNotification -ueb.sink.topics.POLICY-CL-MGT.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gsonPretty +noop.sink.topics.POLICY-CL-MGT.servers=${dmaapServers} +noop.sink.topics.POLICY-CL-MGT.apiKey= +noop.sink.topics.POLICY-CL-MGT.apiSecret= +noop.sink.topics.POLICY-CL-MGT.events=org.onap.policy.controlloop.VirtualControlLoopNotification +noop.sink.topics.POLICY-CL-MGT.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gsonPretty rules.groupId=${groupId} rules.artifactId=${artifactId} diff --git a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/config/__artifactId__-controller.rest.json b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/config/__artifactId__-controller.rest.json index 68d565dcd..356af7d99 100644 --- a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/config/__artifactId__-controller.rest.json +++ b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/config/__artifactId__-controller.rest.json @@ -10,18 +10,18 @@ "ueb.source.topics.APPC-CL.servers": "${dmaapServers}", "ueb.source.topics.APPC-CL.events": "org.onap.policy.appclcm.LCMResponseWrapper", - "ueb.source.topics.APPC-CL.events.org.onap.policy.appclcm.LCMResponseWrapper.filter": "common-header=.*,status=.*", + "ueb.source.topics.APPC-CL.events.org.onap.policy.appclcm.LCMResponseWrapper.filter": "type=response", "ueb.source.topics.APPC-CL.events.custom.gson": "org.onap.policy.appclcm.util.Serialization,gson", - "ueb.sink.topics": "APPC-CL,POLICY-CL-MGT", + "noop.sink.topics": "APPC-CL,POLICY-CL-MGT", - "ueb.sink.topics.APPC-CL.servers": "${dmaapServers}", - "ueb.sink.topics.APPC-CL.events": "org.onap.policy.appclcm.LCMRequestWrapper", - "ueb.sink.topics.APPC-CL.events.custom.gson": "org.onap.policy.appclcm.util.Serialization,gson", + "noop.sink.topics.APPC-CL.servers": "${dmaapServers}", + "noop.sink.topics.APPC-CL.events": "org.onap.policy.appclcm.LCMRequestWrapper", + "noop.sink.topics.APPC-CL.events.custom.gson": "org.onap.policy.appclcm.util.Serialization,gson", - "ueb.sink.topics.POLICY-CL-MGT.servers": "${dmaapServers}", - "ueb.sink.topics.POLICY-CL-MGT.events": "org.onap.policy.controlloop.VirtualControlLoopNotification", - "ueb.sink.topics.POLICY-CL-MGT.events.custom.gson": "org.onap.policy.controlloop.util.Serialization,gson", + "noop.sink.topics.POLICY-CL-MGT.servers": "${dmaapServers}", + "noop.sink.topics.POLICY-CL-MGT.events": "org.onap.policy.controlloop.VirtualControlLoopNotification", + "noop.sink.topics.POLICY-CL-MGT.events.custom.gson": "org.onap.policy.controlloop.util.Serialization,gson", "rules.groupId": "${groupId}", "rules.artifactId": "${artifactId}", diff --git a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl index 3e4f76c2f..5e90f052d 100644 --- a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl +++ b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl @@ -106,12 +106,37 @@ rule "${policyName}.SETUP" params.setControlLoopYaml("${controlLoopYaml}"); insert(params); - // Note: globals have bad behavior when persistence is used, // hence explicitly getting the logger vs using a global Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage()); logger.info("{}: {} : YAML=[{}]", params.getClosedLoopControlName(), drools.getRule().getName(), params.getControlLoopYaml()); + + String sqlDbUsername = PolicyEngine.manager.getEnvironmentProperty("sql.db.username"); + String sqlDbPassword = PolicyEngine.manager.getEnvironmentProperty("sql.db.password"); + + String aaiUrl = PolicyEngine.manager.getEnvironmentProperty("aai.url"); + String aaiUsername = PolicyEngine.manager.getEnvironmentProperty("aai.username"); + String aaiPassword = PolicyEngine.manager.getEnvironmentProperty("aai.password"); + + String soUrl =PolicyEngine.manager.getEnvironmentProperty("so.url"); + String soUsername = PolicyEngine.manager.getEnvironmentProperty("so.username"); + String soPassword = PolicyEngine.manager.getEnvironmentProperty("so.password"); + + String vfcUrl =PolicyEngine.manager.getEnvironmentProperty("vfc.url"); + String vfcUsername = PolicyEngine.manager.getEnvironmentProperty("vfc.username"); + String vfcPassword = PolicyEngine.manager.getEnvironmentProperty("vfc.password"); + + String guardUrl =PolicyEngine.manager.getEnvironmentProperty("guard.url"); + String guardUsername = PolicyEngine.manager.getEnvironmentProperty("guard.username"); + String guardPassword = PolicyEngine.manager.getEnvironmentProperty("guard.password"); + String guardJdbcUrl = PolicyEngine.manager.getEnvironmentProperty("guard.jdbc.url"); + + logger.info("{}: {} : AAI=[{}:{}]", params.getClosedLoopControlName(), drools.getRule().getName(), aaiUrl, aaiUsername); + logger.info("{}: {} : SO=[{}:{}]", params.getClosedLoopControlName(), drools.getRule().getName(), soUrl, soUsername); + logger.info("{}: {} : VFC=[{}:{}]", params.getClosedLoopControlName(), drools.getRule().getName(), vfcUrl, vfcUsername); + logger.info("{}: {} : GUARD=[{}:{}:{}]", params.getClosedLoopControlName(), drools.getRule().getName(), guardUrl, guardUsername, guardJdbcUrl); + logger.info("{}: {} : DB=[{}:{}]", params.getClosedLoopControlName(), drools.getRule().getName(), sqlDbUsername, sqlDbPassword); end /* -- cgit 1.2.3-korg