aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/policy/config/drools-apps/custom/features.pre.sh9
-rw-r--r--scripts/policy/config/drools-apps/env/base.conf42
-rw-r--r--scripts/policy/config/sim-all/simParameters.json98
-rw-r--r--scripts/policy/docker-compose-drools-apps.yml41
-rw-r--r--scripts/policy/drools-apps/custom/papDefaultConfig.json64
-rw-r--r--scripts/policy/drools-apps/custom/xacmlDefaultConfig.json37
-rw-r--r--scripts/policy/drools-apps/deploy.drools.policies.json27
-rw-r--r--scripts/policy/drools-apps/deploy.xacml.policies.json27
-rw-r--r--scripts/policy/drools-apps/docker-compose-drools-apps.yml139
-rwxr-xr-xscripts/policy/drools-apps/make_topic.sh (renamed from scripts/policy/config/drools-apps/custom/noop.pre.sh)32
-rwxr-xr-xscripts/policy/drools-apps/onset.sh32
-rw-r--r--scripts/policy/drools-apps/vcpeOnset.json16
-rw-r--r--scripts/policy/drools-apps/vdnsOnset.json16
-rw-r--r--scripts/policy/drools-apps/vfwOnset.json17
-rwxr-xr-xscripts/policy/drools-apps/wait_topic.sh61
-rw-r--r--scripts/policy/policy-models-dmaap-sim.sh6
-rwxr-xr-xscripts/policy/policy-models-simulators.sh38
17 files changed, 621 insertions, 81 deletions
diff --git a/scripts/policy/config/drools-apps/custom/features.pre.sh b/scripts/policy/config/drools-apps/custom/features.pre.sh
index 93d6c6b9..e9c77a0f 100755
--- a/scripts/policy/config/drools-apps/custom/features.pre.sh
+++ b/scripts/policy/config/drools-apps/custom/features.pre.sh
@@ -1,7 +1,7 @@
#!/bin/bash -x
-# ============LICENSE_START=======================================================
+# ============LICENSE_START===================================================
# Copyright (C) 2020 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
@@ -13,7 +13,6 @@
# 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=========================================================
+# ============LICENSE_END=====================================================
-features disable distributed-locking
-features enable controlloop-utils
+bash -c "features disable distributed-locking"
diff --git a/scripts/policy/config/drools-apps/env/base.conf b/scripts/policy/config/drools-apps/env/base.conf
index b5e7cbd1..673cfaf3 100644
--- a/scripts/policy/config/drools-apps/env/base.conf
+++ b/scripts/policy/config/drools-apps/env/base.conf
@@ -1,6 +1,6 @@
-# ============LICENSE_START=======================================================
+# ============LICENSE_START==================================================
# Copyright (C) 2020 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
@@ -12,7 +12,7 @@
# 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=========================================================
+# ============LICENSE_END====================================================
# JVM options
@@ -78,55 +78,55 @@ PAP_PASSWORD=alpha123
# PDP-X
-PDP_HOST=pdp
+GUARD_DISABLED=false
+PDP_HOST=policy-xacml-pdp
PDP_PORT=6969
PDP_CONTEXT_URI=policy/pdpx/v1/
-PDP_USERNAME=testpdp
-PDP_PASSWORD=alpha123
+PDP_USERNAME=healthcheck
+PDP_PASSWORD=zb!XztG34
PDP_CLIENT_USERNAME=python
PDP_CLIENT_PASSWORD=test
PDP_ENVIRONMENT=TEST
-GUARD_DISABLED=false
# DCAE DMaaP
DCAE_TOPIC=unauthenticated.DCAE_CL_OUTPUT
-DCAE_SERVERS=mr.api.simpledemo.onap.org
+DCAE_SERVERS=policy.api.simpledemo.onap.org
DCAE_CONSUMER_GROUP=dcae.policy.shared
# Open DMaaP
-DMAAP_SERVERS=mr.api.simpledemo.onap.org
+DMAAP_SERVERS=policy.api.simpledemo.onap.org
# AAI
-AAI_HOST=aai.api.simpledemo.onap.org
-AAI_PORT=8443
+AAI_HOST=policy.api.simpledemo.onap.org
+AAI_PORT=6666
AAI_CONTEXT_URI=
AAI_USERNAME=policy@policy.onap.org
AAI_PASSWORD=demo123456!
# MSO
-SO_HOST=vm1.mso.simpledemo.onap.org
-SO_PORT=8080
-SO_CONTEXT_URI=onap/so/infra/
-SO_URL=http://vm1.mso.simpledemo.onap.org:8080/onap/so/infra
+SO_HOST=policy.api.simpledemo.onap.org
+SO_PORT=6669
+SO_CONTEXT_URI=
+SO_URL=https://policy.api.simpledemo.onap.org:6669/
SO_USERNAME=InfraPortalClient
SO_PASSWORD=password1$
# VFC
-VFC_HOST=
-VFC_PORT=
-VFC_CONTEXT_URI=api/nslcm/v1/
+VFC_HOST=policy.api.simpledemo.onap.org
+VFC_PORT=6670
+VFC_CONTEXT_URI=
VFC_USERNAME=
VFC_PASSWORD=
# SDNC
-SDNC_HOST=
-SDNC_PORT=
-SDNC_CONTEXT_URI=restconf/operations/
+SDNC_HOST=policy.api.simpledemo.onap.org
+SDNC_PORT=6668
+SDNC_CONTEXT_URI=
SDNC_USERNAME=
SDNC_PASSWORD=
diff --git a/scripts/policy/config/sim-all/simParameters.json b/scripts/policy/config/sim-all/simParameters.json
new file mode 100644
index 00000000..cd347337
--- /dev/null
+++ b/scripts/policy/config/sim-all/simParameters.json
@@ -0,0 +1,98 @@
+{
+ "dmaapProvider": {
+ "name": "DMaaP simulator",
+ "topicSweepSec": 300,
+ "restServerParameters": { }
+ },
+ "restServers": [
+ {
+ "name": "DMaaP simulator",
+ "providerClass": "org.onap.policy.models.sim.dmaap.rest.DmaapSimRestControllerV1",
+ "host": "0.0.0.0",
+ "port": 3905,
+ "https": true
+ },
+ {
+ "name": "A&AI simulator",
+ "providerClass": "org.onap.policy.simulators.AaiSimulatorJaxRs",
+ "host": "0.0.0.0",
+ "port": 6666,
+ "https": true,
+ "userName": "policy@policy.onap.org",
+ "password": "demo123456!"
+ },
+ {
+ "name": "SDNC simulator",
+ "providerClass": "org.onap.policy.simulators.SdncSimulatorJaxRs",
+ "host": "0.0.0.0",
+ "port": 6668,
+ "https": true
+ },
+ {
+ "name": "SO simulator",
+ "providerClass": "org.onap.policy.simulators.SoSimulatorJaxRs",
+ "host": "0.0.0.0",
+ "port": 6669,
+ "https": true,
+ "userName": "InfraPortalClient",
+ "password": "password1$"
+ },
+ {
+ "name": "VFC simulator",
+ "providerClass": "org.onap.policy.simulators.VfcSimulatorJaxRs",
+ "host": "0.0.0.0",
+ "port": 6670,
+ "https": true
+ }
+ ],
+ "topicSinks": [
+ {
+ "topic": "APPC-CL",
+ "servers": ["${HOST_NAME}"],
+ "topicCommInfrastructure": "DMAAP",
+ "useHttps": true,
+ "apiKey": "some-key",
+ "apiSecret": "some-secret"
+ },
+ {
+ "topic": "APPC-LCM-WRITE",
+ "servers": ["${HOST_NAME}"],
+ "topicCommInfrastructure": "DMAAP",
+ "useHttps": true,
+ "apiKey": "some-key",
+ "apiSecret": "some-secret"
+ }
+ ],
+ "topicSources": [
+ {
+ "topic": "APPC-CL",
+ "servers": ["${HOST_NAME}"],
+ "topicCommInfrastructure": "DMAAP",
+ "useHttps": true,
+ "apiKey": "some-key",
+ "apiSecret": "some-secret"
+ },
+ {
+ "topic": "APPC-LCM-READ",
+ "servers": ["${HOST_NAME}"],
+ "topicCommInfrastructure": "DMAAP",
+ "useHttps": true,
+ "apiKey": "some-key",
+ "apiSecret": "some-secret"
+ }
+ ],
+ "topicServers": [
+ {
+ "name": "APPC Legacy simulator",
+ "providerClass": "org.onap.policy.simulators.AppcLegacyTopicServer",
+ "sink": "APPC-CL",
+ "source": "APPC-CL"
+ },
+ {
+ "name": "APPC-LCM simulator",
+ "providerClass": "org.onap.policy.simulators.AppcLcmTopicServer",
+ "sink": "APPC-LCM-WRITE",
+ "source": "APPC-LCM-READ"
+ }
+ ]
+}
diff --git a/scripts/policy/docker-compose-drools-apps.yml b/scripts/policy/docker-compose-drools-apps.yml
deleted file mode 100644
index 704de81b..00000000
--- a/scripts/policy/docker-compose-drools-apps.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 2019-2020 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.
-version: '2'
-services:
- mariadb:
- image: mariadb:${POLICY_MARIADB_VER}
- container_name: mariadb
- hostname: mariadb
- command: ['--lower-case-table-names=1', '--wait_timeout=28800']
- env_file:
- - ${WORKSPACE}/scripts/policy/config/db/db.conf
- volumes:
- - ${WORKSPACE}/scripts/policy/config/db:/docker-entrypoint-initdb.d
- expose:
- - 3306
- drools:
- image: nexus3.onap.org:10001/onap/policy-pdpd-cl:${POLICY_DROOLS_APPS_VERSION}
- container_name: drools
- depends_on:
- - mariadb
- hostname: drools
- expose:
- - 6969
- - 9696
- volumes:
- - ${WORKSPACE}/scripts/policy/config/drools-apps/custom:/tmp/policy-install/config
- env_file:
- - ${WORKSPACE}/scripts/policy/config/drools-apps/env/base.conf
- - ${WORKSPACE}/scripts/policy/config/drools-apps/env/feature-healthcheck.conf
- - ${WORKSPACE}/scripts/policy/config/drools-apps/env/feature-pooling-dmaap.conf
diff --git a/scripts/policy/drools-apps/custom/papDefaultConfig.json b/scripts/policy/drools-apps/custom/papDefaultConfig.json
new file mode 100644
index 00000000..2575d8a5
--- /dev/null
+++ b/scripts/policy/drools-apps/custom/papDefaultConfig.json
@@ -0,0 +1,64 @@
+{
+ "name": "PapGroup",
+ "restServerParameters": {
+ "host": "0.0.0.0",
+ "port": 6969,
+ "userName": "healthcheck",
+ "password": "zb!XztG34",
+ "https": true,
+ "aaf": false
+ },
+ "pdpParameters": {
+ "heartBeatMs": 120000,
+ "updateParameters": {
+ "maxRetryCount": 1,
+ "maxWaitMs": 30000
+ },
+ "stateChangeParameters": {
+ "maxRetryCount": 1,
+ "maxWaitMs": 30000
+ }
+ },
+ "databaseProviderParameters": {
+ "name": "PolicyProviderParameterGroup",
+ "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
+ "databaseDriver": "org.mariadb.jdbc.Driver",
+ "databaseUrl": "jdbc:mariadb://mariadb:3306/policyadmin",
+ "databaseUser": "policy_user",
+ "databasePassword": "cG9saWN5X3VzZXI=",
+ "persistenceUnit": "PolicyMariaDb"
+ },
+ "topicParameterGroup": {
+ "topicSources" : [{
+ "topic" : "POLICY-PDP-PAP",
+ "servers" : [ "policy.api.simpledemo.onap.org" ],
+ "topicCommInfrastructure" : "dmaap",
+ "useHttps": true,
+ "allowSelfSignedCerts" : true
+ }],
+ "topicSinks" : [{
+ "topic" : "POLICY-PDP-PAP",
+ "servers" : [ "policy.api.simpledemo.onap.org" ],
+ "topicCommInfrastructure" : "dmaap",
+ "useHttps": true,
+ "allowSelfSignedCerts" : true
+ },
+ {
+ "topic" : "POLICY-NOTIFICATION",
+ "servers" : [ "policy.api.simpledemo.onap.org" ],
+ "topicCommInfrastructure" : "dmaap",
+ "useHttps": true,
+ "allowSelfSignedCerts" : true
+ }]
+ },
+ "healthCheckRestClientParameters":[{
+ "clientName": "api",
+ "hostname": "policy-api",
+ "port": 6969,
+ "userName": "healthcheck",
+ "password": "zb!XztG34",
+ "useHttps": true,
+ "allowSelfSignedCerts" : true,
+ "basePath": "policy/api/v1/healthcheck"
+ }]
+}
diff --git a/scripts/policy/drools-apps/custom/xacmlDefaultConfig.json b/scripts/policy/drools-apps/custom/xacmlDefaultConfig.json
new file mode 100644
index 00000000..5a6573a3
--- /dev/null
+++ b/scripts/policy/drools-apps/custom/xacmlDefaultConfig.json
@@ -0,0 +1,37 @@
+{
+ "name": "XacmlPdpParameters",
+ "pdpGroup": "defaultGroup",
+ "restServerParameters": {
+ "host": "0.0.0.0",
+ "port": 6969,
+ "userName": "healthcheck",
+ "password": "zb!XztG34",
+ "https": true,
+ "aaf": false
+ },
+ "policyApiParameters": {
+ "host": "policy-api",
+ "port": 6969,
+ "userName": "healthcheck",
+ "password": "zb!XztG34",
+ "https": true,
+ "aaf": false
+ },
+ "applicationPath": "/opt/app/policy/pdpx/apps",
+ "topicParameterGroup": {
+ "topicSources" : [{
+ "topic" : "POLICY-PDP-PAP",
+ "servers" : [ "policy.api.simpledemo.onap.org" ],
+ "topicCommInfrastructure" : "dmaap",
+ "useHttps" : true,
+ "allowSelfSignedCerts" : true
+ }],
+ "topicSinks" : [{
+ "topic" : "POLICY-PDP-PAP",
+ "servers" : [ "policy.api.simpledemo.onap.org" ],
+ "topicCommInfrastructure" : "dmaap",
+ "useHttps" : true,
+ "allowSelfSignedCerts" : true
+ }]
+ }
+}
diff --git a/scripts/policy/drools-apps/deploy.drools.policies.json b/scripts/policy/drools-apps/deploy.drools.policies.json
new file mode 100644
index 00000000..24c90d0d
--- /dev/null
+++ b/scripts/policy/drools-apps/deploy.drools.policies.json
@@ -0,0 +1,27 @@
+{
+ "groups": [
+ {
+ "name": "defaultGroup",
+ "deploymentSubgroups": [
+ {
+ "pdpType": "drools",
+ "action": "POST",
+ "policies": [
+ {
+ "name": "operational.restart",
+ "version": "1.0.0"
+ },
+ {
+ "name": "operational.scaleout",
+ "version": "1.0.0"
+ },
+ {
+ "name": "operational.modifyconfig",
+ "version": "1.0.0"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/scripts/policy/drools-apps/deploy.xacml.policies.json b/scripts/policy/drools-apps/deploy.xacml.policies.json
new file mode 100644
index 00000000..46da9021
--- /dev/null
+++ b/scripts/policy/drools-apps/deploy.xacml.policies.json
@@ -0,0 +1,27 @@
+{
+ "groups": [
+ {
+ "name": "defaultGroup",
+ "deploymentSubgroups": [
+ {
+ "pdpType": "xacml",
+ "action": "POST",
+ "policies": [
+ {
+ "name": "onap.restart.tca",
+ "version": "1.0.0"
+ },
+ {
+ "name": "onap.scaleout.tca",
+ "version": "1.0.0"
+ },
+ {
+ "name": "onap.vfirewall.tca",
+ "version": "1.0.0"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/scripts/policy/drools-apps/docker-compose-drools-apps.yml b/scripts/policy/drools-apps/docker-compose-drools-apps.yml
new file mode 100644
index 00000000..5098a177
--- /dev/null
+++ b/scripts/policy/drools-apps/docker-compose-drools-apps.yml
@@ -0,0 +1,139 @@
+#
+# ===========LICENSE_START====================================================
+# Copyright (C) 2020 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=====================================================
+#
+version: '2'
+services:
+ mariadb:
+ image: mariadb:${POLICY_MARIADB_VER}
+ container_name: mariadb
+ hostname: mariadb
+ command: ['--lower-case-table-names=1', '--wait_timeout=28800']
+ env_file: ../config/db/db.conf
+ volumes:
+ - ../config/db:/docker-entrypoint-initdb.d:ro
+ expose:
+ - 3306
+ policy.api.simpledemo.onap.org:
+ image: policy/simulators
+ container_name: policy.api.simpledemo.onap.org
+ hostname: policy.api.simpledemo.onap.org
+ volumes:
+ - ../config/sim-all:/opt/app/policy/simulators/etc/parameters:ro
+ expose:
+ - 6666
+ - 6668
+ - 6669
+ - 6670
+ - 3905
+ api:
+ image: nexus3.onap.org:10001/onap/policy-api:${POLICY_API_VERSION}
+ container_name: policy-api
+ depends_on:
+ - mariadb
+ hostname: policy-api
+ expose:
+ - 6969
+ pap:
+ image: nexus3.onap.org:10001/onap/policy-pap:${POLICY_PAP_VERSION}
+ container_name: policy-pap
+ depends_on:
+ - mariadb
+ hostname: policy-pap
+ expose:
+ - 6969
+ volumes:
+ - ./custom/papDefaultConfig.json:/opt/app/policy/pap/etc/defaultConfig.json:ro
+ policy-xacml-pdp:
+ image: nexus3.onap.org:10001/onap/policy-xacml-pdp:${POLICY_XACML_PDP_VERSION}
+ container_name: policy-xacml-pdp
+ depends_on:
+ - mariadb
+ - policy.api.simpledemo.onap.org
+ hostname: policy-xacml-pdp
+ expose:
+ - 6969
+ volumes:
+ - ./custom/xacmlDefaultConfig.json:/opt/app/policy/pdpx/etc/defaultConfig.json:ro
+ drools:
+ image: nexus3.onap.org:10001/onap/policy-pdpd-cl:${POLICY_DROOLS_APPS_VERSION}
+ container_name: drools
+ depends_on:
+ - mariadb
+ - policy.api.simpledemo.onap.org
+ hostname: drools
+ expose:
+ - 6969
+ - 9696
+ volumes:
+ - ../config/drools-apps/custom:/tmp/policy-install/config:ro
+ env_file:
+ - ../config/drools-apps/env/base.conf
+ - ../config/drools-apps/env/feature-healthcheck.conf
+ - ../config/drools-apps/env/feature-pooling-dmaap.conf
+ start_dependencies:
+ image: dadarek/wait-for-dependencies
+ environment:
+ TIMEOUT_LENGTH: 60
+ container_name: policy-wait
+ depends_on:
+ - mariadb
+ - policy.api.simpledemo.onap.org
+ hostname: policy-wait
+ command:
+ mariadb:3306
+ policy.api.simpledemo.onap.org:6666
+ policy.api.simpledemo.onap.org:6668
+ policy.api.simpledemo.onap.org:6669
+ policy.api.simpledemo.onap.org:6670
+ policy.api.simpledemo.onap.org:3905
+ start_pap:
+ image: dadarek/wait-for-dependencies
+ environment:
+ TIMEOUT_LENGTH: 120
+ container_name: policy-wait-pap
+ depends_on:
+ - mariadb
+ - policy.api.simpledemo.onap.org
+ - pap
+ hostname: policy-wait-pap
+ command:
+ mariadb:3306
+ policy.api.simpledemo.onap.org:3905
+ pap:6969
+ start_all:
+ image: dadarek/wait-for-dependencies
+ environment:
+ TIMEOUT_LENGTH: 120
+ container_name: policy-wait-all
+ depends_on:
+ - mariadb
+ - policy.api.simpledemo.onap.org
+ - api
+ - pap
+ - policy-xacml-pdp
+ - drools
+ hostname: policy-wait-all
+ command:
+ mariadb:3306
+ policy.api.simpledemo.onap.org:6666
+ policy.api.simpledemo.onap.org:6668
+ policy.api.simpledemo.onap.org:6669
+ policy.api.simpledemo.onap.org:6670
+ policy.api.simpledemo.onap.org:3905
+ api:6969
+ pap:6969
+ drools:6969
diff --git a/scripts/policy/config/drools-apps/custom/noop.pre.sh b/scripts/policy/drools-apps/make_topic.sh
index 4b0c2199..36d43e9d 100755
--- a/scripts/policy/config/drools-apps/custom/noop.pre.sh
+++ b/scripts/policy/drools-apps/make_topic.sh
@@ -1,7 +1,8 @@
-#!/bin/bash -x
-# ============LICENSE_START=======================================================
-# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
+#!/bin/bash
+#
+# ===========LICENSE_START====================================================
+# Copyright (C) 2020 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
@@ -13,13 +14,20 @@
# 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=========================================================
+# ============LICENSE_END=====================================================
+#
+
+#
+# Creates a topic, which happens as a side-effect of polling it.
+#
+
+if [ $# -ne 1 ]
+then
+ echo "arg(s): topic-name" >&2
+ exit 1
+fi
-sed -i "s/^dmaap/noop/g" \
- ${POLICY_HOME}/config/engine.properties \
- ${POLICY_HOME}/config/feature-lifecycle.properties \
- ${POLICY_HOME}/config/frankfurt-controller.properties
+topic="${1}"
-chmod 644 ${POLICY_HOME}/config/engine.properties \
- ${POLICY_HOME}/config/feature-lifecycle.properties \
- ${POLICY_HOME}/config/frankfurt-controller.properties
+curl -s -k "https://${SIM_IP}:3905/events/${topic}/script/1?limit=1&timeout=0"
+echo
diff --git a/scripts/policy/drools-apps/onset.sh b/scripts/policy/drools-apps/onset.sh
new file mode 100755
index 00000000..f2918a68
--- /dev/null
+++ b/scripts/policy/drools-apps/onset.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+#
+# ===========LICENSE_START====================================================
+# Copyright (C) 2020 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=====================================================
+#
+
+#
+# Injects an ONSET event on the DCAE_CL_OUTPUT topic.
+#
+
+if [ $# -ne 1 ]
+then
+ echo "arg(s): json-message-file-name" >&2
+ exit 1
+fi
+
+curl -k -H "Content-type: application/json" --data-binary @$1 \
+ https://${SIM_IP}:3905/events/unauthenticated.DCAE_CL_OUTPUT
+echo
diff --git a/scripts/policy/drools-apps/vcpeOnset.json b/scripts/policy/drools-apps/vcpeOnset.json
new file mode 100644
index 00000000..7dd9d5a0
--- /dev/null
+++ b/scripts/policy/drools-apps/vcpeOnset.json
@@ -0,0 +1,16 @@
+{
+ "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
+ "closedLoopAlarmStart": 1463679805324,
+ "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca",
+ "closedLoopEventStatus": "ONSET",
+ "requestID": "664be3d2-6c12-4f4b-a3e7-c349acced200",
+ "target_type": "VNF",
+ "target": "generic-vnf.vnf-id",
+ "AAI": {
+ "vserver.is-closed-loop-disabled": "false",
+ "vserver.prov-status": "ACTIVE",
+ "generic-vnf.vnf-id": "vCPE_Infrastructure_vGMUX_demo_app"
+ },
+ "from": "DCAE",
+ "version": "1.0.2"
+}
diff --git a/scripts/policy/drools-apps/vdnsOnset.json b/scripts/policy/drools-apps/vdnsOnset.json
new file mode 100644
index 00000000..13f69095
--- /dev/null
+++ b/scripts/policy/drools-apps/vdnsOnset.json
@@ -0,0 +1,16 @@
+{
+ "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
+ "closedLoopAlarmStart": 1463679805324,
+ "closedLoopEventClient": "microservice.stringmatcher",
+ "closedLoopEventStatus": "ONSET",
+ "requestID": "c7c6a4aa-bb61-4a15-b831-ba1472dd4a65",
+ "target_type": "VNF",
+ "target": "vserver.vserver-name",
+ "AAI": {
+ "vserver.is-closed-loop-disabled": "false",
+ "vserver.prov-status": "ACTIVE",
+ "vserver.vserver-name": "OzVServer"
+ },
+ "from": "DCAE",
+ "version": "1.0.2"
+}
diff --git a/scripts/policy/drools-apps/vfwOnset.json b/scripts/policy/drools-apps/vfwOnset.json
new file mode 100644
index 00000000..7782867a
--- /dev/null
+++ b/scripts/policy/drools-apps/vfwOnset.json
@@ -0,0 +1,17 @@
+{
+ "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
+ "closedLoopAlarmStart": 1463679805324,
+ "closedLoopEventClient": "microservice.stringmatcher",
+ "closedLoopEventStatus": "ONSET",
+ "requestID": "c7c6a4aa-bb61-4a15-b831-ba1472dd4a65",
+ "target_type": "VNF",
+ "target": "generic-vnf.vnf-name",
+ "AAI": {
+ "vserver.is-closed-loop-disabled": "false",
+ "vserver.prov-status": "ACTIVE",
+ "generic-vnf.vnf-name": "fw0002vm002fw002",
+ "vserver.vserver-name": "OzVServer"
+ },
+ "from": "DCAE",
+ "version": "1.0.2"
+}
diff --git a/scripts/policy/drools-apps/wait_topic.sh b/scripts/policy/drools-apps/wait_topic.sh
new file mode 100755
index 00000000..4271abc6
--- /dev/null
+++ b/scripts/policy/drools-apps/wait_topic.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+#
+# ===========LICENSE_START====================================================
+# Copyright (C) 2020 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=====================================================
+#
+
+#
+# Polls a topic for a message. Additional text items can be specified,
+# in which case, it discards messages that do not contain all of the
+# specified text items.
+#
+# Exits with a non-zero status if no matching message is received on the
+# topic before the timeout.
+#
+
+if [ $# -lt 1 ]
+then
+ echo "arg(s): topic-name [text-to-match1 [text-to-match2 ...]]" >&2
+ exit 1
+fi
+
+topic="${1}"
+shift
+
+matched=no
+
+while [ ${matched} = "no" ]
+do
+ msg=`curl -s -k "https://${SIM_IP}:3905/events/${topic}/script/1?limit=1"`
+ if [ $? -ne 0 -o "${msg}" = "[]" ]
+ then
+ echo not found >&2
+ exit 2
+ fi
+
+ matched=yes
+ for text in "$@"
+ do
+ echo "${msg}" | grep -q "${text}"
+ if [ $? -ne 0 ]
+ then
+ matched=no
+ break
+ fi
+ done
+done
+
+echo "${msg}"
diff --git a/scripts/policy/policy-models-dmaap-sim.sh b/scripts/policy/policy-models-dmaap-sim.sh
index 0abd9f94..2839e5c3 100644
--- a/scripts/policy/policy-models-dmaap-sim.sh
+++ b/scripts/policy/policy-models-dmaap-sim.sh
@@ -19,6 +19,10 @@
source ${SCRIPTS}/policy/config/policy-csit.conf
+rm -rf ${WORKSPACE}/dmaap-sim
+mkdir ${WORKSPACE}/dmaap-sim
+cd ${WORKSPACE}/dmaap-sim
+
POLICY_MODELS_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/models/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
export POLICY_MODELS_VERSION="${POLICY_MODELS_VERSION_EXTRACT}"
echo ${POLICY_MODELS_VERSION}
@@ -31,5 +35,3 @@ mkdir target
curl -L $item -o target/policy-models-sim-dmaap-${POLICY_MODELS_VERSION}-tarball.tar.gz
bash ./src/main/package/docker/docker_build.sh
cd ${WORKSPACE}
-rm -rf ${WORK_DIR}
-
diff --git a/scripts/policy/policy-models-simulators.sh b/scripts/policy/policy-models-simulators.sh
new file mode 100755
index 00000000..9e67d487
--- /dev/null
+++ b/scripts/policy/policy-models-simulators.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+#
+# ============LICENSE_START===================================================
+# Copyright (C) 2020 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=====================================================
+#
+
+source ${SCRIPTS}/policy/config/policy-csit.conf
+
+rm -rf ${WORKSPACE}/simulators
+mkdir ${WORKSPACE}/simulators
+cd ${WORKSPACE}/simulators
+
+POLICY_MODELS_VERSION_EXTRACT="$(curl -q --silent https://git.onap.org/policy/models/plain/pom.xml?h=${GERRIT_BRANCH} | xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -)"
+export POLICY_MODELS_VERSION="${POLICY_MODELS_VERSION_EXTRACT}"
+echo ${POLICY_MODELS_VERSION}
+
+# download simulators tarball and build docker image
+git clone --depth 1 https://gerrit.onap.org/r/policy/models -b ${GERRIT_BRANCH}
+cd models/models-sim/policy-models-simulators
+item=`curl --silent -L ${NEXUS_URL}/org/onap/policy/models/sim/policy-models-simulators/${POLICY_MODELS_VERSION} | egrep 'policy-models-simulators-.*tarball' | cut '-d"' -f2 | egrep 'gz$' | sort | tail -1`
+mkdir target
+curl -L $item -o target/policy-models-simulators-${POLICY_MODELS_VERSION}-tarball.tar.gz
+bash ./src/main/package/docker/docker_build.sh
+
+cd ${WORKSPACE}