Merge "Add k8s yml file for oru application"
authorHenrik Andersson <henrik.b.andersson@est.tech>
Tue, 1 Jun 2021 10:30:11 +0000 (10:30 +0000)
committerGerrit Code Review <gerrit@o-ran-sc.org>
Tue, 1 Jun 2021 10:30:11 +0000 (10:30 +0000)
40 files changed:
docker-compose/docker-compose-policy-framework/config/apex-pdp/OnapPfConfig.json [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/db/db.conf [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/db/db.sh [new file with mode: 0755]
docker-compose/docker-compose-policy-framework/config/distribution/defaultConfig.json [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/dns_keystore.txt [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/AAI-http-client.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/APPC-CL-topic.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/APPC-LCM-READ-topic.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/APPC-LCM-WRITE-topic.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/DCAE_CL_RSP-topic.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/DCAE_TOPIC-topic.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/GUARD-http-client.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/POLICY-CL-MGT-topic.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/SDNC-http-client.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/SDNR-CL-RSP-topic.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/SDNR-CL-topic.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/SO-http-client.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/VFC-http-client.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/engine-system.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/engine.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/feature-lifecycle.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/features.pre.sh [new file with mode: 0755]
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/standalone-settings.xml [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/env/base.conf [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/env/feature-healthcheck.conf [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools-apps/env/feature-pooling-dmaap.conf [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools/custom/engine-system.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools/custom/engine.properties [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/drools/custom/noop.pre.sh [new file with mode: 0755]
docker-compose/docker-compose-policy-framework/config/drools/env/base.conf [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/pap/defaultConfig.json [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/config/xacml-pdp/defaultConfig.json [new file with mode: 0644]
docker-compose/docker-compose-policy-framework/docker-compose.yml [new file with mode: 0644]
test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/config/LinkMonitorConfigDmaap2RestJsonEvent.json
test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/config/o-ru-to-o-du-map.json [deleted file]
test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/deployment/DeployPolicyPAP.json [new file with mode: 0644]
test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/deployment/ToscaPolicy.json [new file with mode: 0644]
test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/models/CreateLinkFailureOutfieldsLogic.js
test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/models/ToscaPolicy.json [deleted file]
test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/tosca/ToscaTemplate.json

diff --git a/docker-compose/docker-compose-policy-framework/config/apex-pdp/OnapPfConfig.json b/docker-compose/docker-compose-policy-framework/config/apex-pdp/OnapPfConfig.json
new file mode 100644 (file)
index 0000000..e1f6b23
--- /dev/null
@@ -0,0 +1,43 @@
+{
+    "name":"OnapPfParameterGroup",
+     "restServerParameters": {
+        "host": "0.0.0.0",
+        "port": 6969,
+        "userName": "healthcheck",
+        "password": "zb!XztG34",
+        "https": true
+    },
+    "pdpStatusParameters":{
+        "pdpGroup": "defaultGroup",
+        "timeIntervalMs": 120000,
+        "pdpType":"apex",
+        "desiredInstanceCount": 2,
+        "description":"Pdp Heartbeat",
+        "supportedPolicyTypes": [
+            {
+              "name": "onap.policies.controlloop.operational.common.Apex",
+              "version": "1.0.0"
+            },
+            {
+                "name": "onap.policies.native.Apex",
+                "version": "1.0.0"
+            }
+        ]
+    },
+    "topicParameterGroup": {
+        "topicSources" : [{
+            "topic" : "POLICY-PDP-PAP",
+            "servers" : [ "dmaap-mr" ],
+            "topicCommInfrastructure" : "dmaap",
+            "useHttps" : false,
+            "allowSelfSignedCerts" : true
+        }],
+        "topicSinks" : [{
+            "topic" : "POLICY-PDP-PAP",
+            "servers" : [ "dmaap-mr" ],
+            "topicCommInfrastructure" : "dmaap",
+            "useHttps" : false,
+            "allowSelfSignedCerts" : true
+        }]
+    }
+}
diff --git a/docker-compose/docker-compose-policy-framework/config/db/db.conf b/docker-compose/docker-compose-policy-framework/config/db/db.conf
new file mode 100644 (file)
index 0000000..22b37f8
--- /dev/null
@@ -0,0 +1,16 @@
+# Copyright 2019,2021 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.
+MYSQL_ROOT_PASSWORD=secret
+MYSQL_USER=policy_user
+MYSQL_PASSWORD=policy_user
diff --git a/docker-compose/docker-compose-policy-framework/config/db/db.sh b/docker-compose/docker-compose-policy-framework/config/db/db.sh
new file mode 100755 (executable)
index 0000000..a5c8129
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash -xv
+# Copyright 2019,2021 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.
+
+for db in support onap_sdk log migration operationshistory10 pooling policyadmin operationshistory
+do
+    mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};"
+    mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;"
+done
+
+mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;"
diff --git a/docker-compose/docker-compose-policy-framework/config/distribution/defaultConfig.json b/docker-compose/docker-compose-policy-framework/config/distribution/defaultConfig.json
new file mode 100644 (file)
index 0000000..140fd70
--- /dev/null
@@ -0,0 +1,73 @@
+{
+    "name":"SDCDistributionGroup",
+    "restServerParameters":{
+        "host":"0.0.0.0",
+        "port":6969,
+        "userName":"healthcheck",
+        "password":"zb!XztG34",
+        "https": true
+    },
+    "receptionHandlerParameters":{
+        "FileReceptionHandler":{
+            "receptionHandlerType":"File",
+            "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.file.FileSystemReceptionHandler",
+            "receptionHandlerConfigurationName":"fileConfiguration",
+            "pluginHandlerParameters":{
+                "policyDecoders":{
+                    "ApexDecoder":{
+                        "decoderType":"ApexDecoder",
+                        "decoderClassName":"org.onap.policy.distribution.reception.decoding.policy.file.PolicyDecoderFileInCsarToPolicy",
+                        "decoderConfigurationName": "apexDecoderConfiguration"
+                    }
+                },
+                "policyForwarders":{
+                    "LifeCycleApiForwarder":{
+                        "forwarderType":"LifeCycleAPI",
+                        "forwarderClassName":"org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiPolicyForwarder",
+                        "forwarderConfigurationName": "lifecycleApiConfiguration"
+                    }
+                }
+            }
+        }
+    },
+    "receptionHandlerConfigurationParameters":{
+        "fileConfiguration":{
+            "parameterClassName":"org.onap.policy.distribution.reception.handling.file.FileSystemReceptionHandlerConfigurationParameterGroup",
+            "parameters":{
+                "watchPath": "/opt/app/policy/distribution/etc/temp/",
+                "maxThread": 1
+            }
+        }
+    },
+    "policyDecoderConfigurationParameters":{
+        "apexDecoderConfiguration":{
+            "parameterClassName":"org.onap.policy.distribution.reception.decoding.policy.file.PolicyDecoderFileInCsarToPolicyParameterGroup",
+            "parameters":{
+                "policyFileName": "apex_policy.json",
+                "policyTypeFileName": "apex_policy_type.json"
+            }
+        }
+    },
+    "policyForwarderConfigurationParameters":{
+        "lifecycleApiConfiguration":{
+            "parameterClassName":"org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiForwarderParameters",
+            "parameters":{
+                "apiParameters": {
+                    "hostName": "policy-api",
+                    "port": 6969,
+                    "userName": "healthcheck",
+                    "password": "zb!XztG34"
+                },
+                "papParameters": {
+                    "hostName": "policy-pap",
+                    "port": 6969,
+                    "userName": "healthcheck",
+                    "password": "zb!XztG34"
+                },
+                "isHttps": true,
+                "allowSelfSignedCerts": true,
+                "deployPolicies": true
+            }
+        }
+    }
+}
diff --git a/docker-compose/docker-compose-policy-framework/config/dns_keystore.txt b/docker-compose/docker-compose-policy-framework/config/dns_keystore.txt
new file mode 100644 (file)
index 0000000..b42a22b
--- /dev/null
@@ -0,0 +1,14 @@
+DNS:policy
+DNS:drools
+DNS:drools.onap
+DNS:policy-apex-pdp
+DNS:policy-apex-pdp.onap
+DNS:policy-api
+DNS:policy-api.onap
+DNS:policy-distribution
+DNS:policy-distribution.onap
+DNS:policy-pap
+DNS:policy-pap.onap
+DNS:policy-xacml-pdp
+DNS:policy-xacml-pdp.onap
+DNS:dmaap-mr
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/AAI-http-client.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/AAI-http-client.properties
new file mode 100644 (file)
index 0000000..35fa7f6
--- /dev/null
@@ -0,0 +1,28 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+
+http.client.services=AAI
+
+http.client.services.AAI.managed=true
+http.client.services.AAI.https=true
+http.client.services.AAI.host=${envd:AAI_HOST}
+http.client.services.AAI.port=${envd:AAI_PORT}
+http.client.services.AAI.userName=${envd:AAI_USERNAME}
+http.client.services.AAI.password=${envd:AAI_PASSWORD}
+http.client.services.AAI.contextUriPath=${envd:AAI_CONTEXT_URI}
+http.client.services.AAI.selfSignedCertificates=true
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/APPC-CL-topic.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/APPC-CL-topic.properties
new file mode 100644 (file)
index 0000000..f265b7c
--- /dev/null
@@ -0,0 +1,28 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+
+dmaap.source.topics=APPC-CL
+dmaap.sink.topics=APPC-CL
+
+dmaap.source.topics.APPC-CL.servers=${env:DMAAP_SERVERS}
+dmaap.source.topics.APPC-CL.https=true
+dmaap.source.topics.APPC-CL.selfSignedCertificates=true
+
+dmaap.sink.topics.APPC-CL.servers=${env:DMAAP_SERVERS}
+dmaap.sink.topics.APPC-CL.https=true
+dmaap.sink.topics.APPC-CL.selfSignedCertificates=true
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/APPC-LCM-READ-topic.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/APPC-LCM-READ-topic.properties
new file mode 100644 (file)
index 0000000..f4a48dc
--- /dev/null
@@ -0,0 +1,23 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+
+dmaap.sink.topics=APPC-LCM-READ
+
+dmaap.sink.topics.APPC-LCM-READ.servers=${env:DMAAP_SERVERS}
+dmaap.sink.topics.APPC-LCM-READ.https=true
+dmaap.sink.topics.APPC-LCM-READ.selfSignedCertificates=true
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/APPC-LCM-WRITE-topic.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/APPC-LCM-WRITE-topic.properties
new file mode 100644 (file)
index 0000000..51cb018
--- /dev/null
@@ -0,0 +1,23 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+
+dmaap.source.topics=APPC-LCM-WRITE
+
+dmaap.source.topics.APPC-LCM-WRITE.servers=${env:DMAAP_SERVERS}
+dmaap.source.topics.APPC-LCM-WRITE.https=true
+dmaap.source.topics.APPC-LCM-WRITE.selfSignedCertificates=true
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/DCAE_CL_RSP-topic.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/DCAE_CL_RSP-topic.properties
new file mode 100644 (file)
index 0000000..b02f90c
--- /dev/null
@@ -0,0 +1,23 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+
+dmaap.sink.topics=DCAE_CL_RSP
+
+dmaap.sink.topics.DCAE_CL_RSP.servers=${env:DMAAP_SERVERS}
+dmaap.sink.topics.DCAE_CL_RSP.https=true
+dmaap.sink.topics.DCAE_CL_RSP.selfSignedCertificates=true
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/DCAE_TOPIC-topic.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/DCAE_TOPIC-topic.properties
new file mode 100644 (file)
index 0000000..608ba8d
--- /dev/null
@@ -0,0 +1,25 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+
+dmaap.source.topics=DCAE_TOPIC
+
+dmaap.source.topics.DCAE_TOPIC.effectiveTopic=${env:DCAE_TOPIC}
+dmaap.source.topics.DCAE_TOPIC.servers=${env:DMAAP_SERVERS}
+dmaap.source.topics.DCAE_TOPIC.consumerGroup=${env:DCAE_CONSUMER_GROUP}
+dmaap.source.topics.DCAE_TOPIC.https=true
+dmaap.source.topics.DCAE_TOPIC.selfSignedCertificates=true
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/GUARD-http-client.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/GUARD-http-client.properties
new file mode 100644 (file)
index 0000000..e4c2553
--- /dev/null
@@ -0,0 +1,28 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+
+http.client.services=GUARD
+
+http.client.services.GUARD.managed=true
+http.client.services.GUARD.https=true
+http.client.services.GUARD.host=${envd:PDP_HOST}
+http.client.services.GUARD.port=${envd:PDP_PORT}
+http.client.services.GUARD.userName=${envd:PDP_USERNAME}
+http.client.services.GUARD.password=${envd:PDP_PASSWORD}
+http.client.services.GUARD.contextUriPath=${envd:PDP_CONTEXT_URI:policy/pdpx/v1/}
+http.client.services.GUARD.selfSignedCertificates=true
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/POLICY-CL-MGT-topic.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/POLICY-CL-MGT-topic.properties
new file mode 100644 (file)
index 0000000..f2b6826
--- /dev/null
@@ -0,0 +1,22 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+
+dmaap.sink.topics=POLICY-CL-MGT
+dmaap.sink.topics.POLICY-CL-MGT.servers=${env:DMAAP_SERVERS}
+dmaap.sink.topics.POLICY-CL-MGT.https=true
+dmaap.sink.topics.POLICY-CL-MGT.selfSignedCertificates=true
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/SDNC-http-client.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/SDNC-http-client.properties
new file mode 100644 (file)
index 0000000..9115950
--- /dev/null
@@ -0,0 +1,28 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+
+http.client.services=SDNC
+
+http.client.services.SDNC.managed=true
+http.client.services.SDNC.https=true
+http.client.services.SDNC.host=${envd:SDNC_HOST}
+http.client.services.SDNC.port=${envd:SDNC_PORT}
+http.client.services.SDNC.userName=${envd:SDNC_USERNAME}
+http.client.services.SDNC.password=${envd:SDNC_PASSWORD}
+http.client.services.SDNC.contextUriPath=${envd:SDNC_CONTEXT_URI}
+http.client.services.SDNC.selfSignedCertificates=true
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/SDNR-CL-RSP-topic.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/SDNR-CL-RSP-topic.properties
new file mode 100644 (file)
index 0000000..27a762c
--- /dev/null
@@ -0,0 +1,22 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+
+dmaap.source.topics=SDNR-CL-RSP
+dmaap.source.topics.SDNR-CL-RSP.servers=${env:DMAAP_SERVERS}
+dmaap.source.topics.SDNR-CL-RSP.https=true
+dmaap.source.topics.SDNR-CL-RSP.selfSignedCertificates=true
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/SDNR-CL-topic.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/SDNR-CL-topic.properties
new file mode 100644 (file)
index 0000000..8f2a26c
--- /dev/null
@@ -0,0 +1,23 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+
+dmaap.sink.topics=SDNR-CL
+
+dmaap.sink.topics.SDNR-CL.servers=${env:DMAAP_SERVERS}
+dmaap.sink.topics.SDNR-CL.https=true
+dmaap.sink.topics.SDNR-CL.selfSignedCertificates=true
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/SO-http-client.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/SO-http-client.properties
new file mode 100644 (file)
index 0000000..7e71e35
--- /dev/null
@@ -0,0 +1,28 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+
+http.client.services=SO
+
+http.client.services.SO.managed=true
+http.client.services.SO.https=false
+http.client.services.SO.host=${envd:SO_HOST}
+http.client.services.SO.port=${envd:SO_PORT}
+http.client.services.SO.userName=${envd:SO_USERNAME}
+http.client.services.SO.password=${envd:SO_PASSWORD}
+http.client.services.SO.contextUriPath=${envd:SO_CONTEXT_URI}
+http.client.services.SO.selfSignedCertificates=true
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/VFC-http-client.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/VFC-http-client.properties
new file mode 100644 (file)
index 0000000..454e8a9
--- /dev/null
@@ -0,0 +1,28 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+
+http.client.services=VFC
+
+http.client.services.VFC.managed=true
+http.client.services.VFC.https=true
+http.client.services.VFC.host=${envd:VFC_HOST}
+http.client.services.VFC.port=${envd:VFC_PORT}
+http.client.services.VFC.userName=${envd:VFC_USERNAME}
+http.client.services.VFC.password=${envd:VFC_PASSWORD}
+http.client.services.VFC.contextUriPath=${envd:VFC_CONTEXT_URI:api/nslcm/v1/}
+http.client.services.VFC.selfSignedCertificates=true
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/engine-system.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/engine-system.properties
new file mode 100644 (file)
index 0000000..19e03b5
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+#
+
+# system properties set within the application
+
+java.net.preferIPv4Stack=true
+
+# jmx
+
+com.sun.management.jmxremote.port=9991
+com.sun.management.jmxremote.authenticate=false
+com.sun.management.jmxremote.ssl=false
+
+# certs
+
+javax.net.ssl.trustStore=${envd:TRUSTSTORE:/opt/app/policy/etc/ssl/policy-truststore}
+javax.net.ssl.trustStorePassword=${envd:TRUSTSTORE_PASSWD:Pol1cy_0nap}
+
+javax.net.ssl.keyStore=${envd:KEYSTORE:/opt/app/policy/etc/ssl/policy-keystore}
+javax.net.ssl.keyStorePassword=${envd:KEYSTORE_PASSWD:Pol1cy_0nap}
+
+# kie
+
+kie.maven.offline.force=${envd:REPOSITORY_OFFLINE:false}
+
+# symmetric key for sensitive configuration data
+
+engine.symm.key=${envd:SYMM_KEY}
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/engine.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/engine.properties
new file mode 100644 (file)
index 0000000..cf2ed85
--- /dev/null
@@ -0,0 +1,50 @@
+###
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+###
+
+# Policy Engine Configuration Channels
+
+dmaap.source.topics=PDPD-CONFIGURATION
+
+dmaap.source.topics.PDPD-CONFIGURATION.servers=${envd:DMAAP_SERVERS}
+dmaap.source.topics.PDPD-CONFIGURATION.effectiveTopic=${envd:PDPD_CONFIGURATION_TOPIC}
+dmaap.source.topics.PDPD-CONFIGURATION.apiKey=${envd:PDPD_CONFIGURATION_API_KEY}
+dmaap.source.topics.PDPD-CONFIGURATION.apiSecret=${envd:PDPD_CONFIGURATION_API_SECRET}
+dmaap.source.topics.PDPD-CONFIGURATION.consumerGroup=${envd:PDPD_CONFIGURATION_CONSUMER_GROUP}
+dmaap.source.topics.PDPD-CONFIGURATION.consumerInstance=${envd:PDPD_CONFIGURATION_CONSUMER_INSTANCE}
+dmaap.source.topics.PDPD-CONFIGURATION.managed=false
+dmaap.source.topics.PDPD-CONFIGURATION.https=true
+dmaap.source.topics.PDPD-CONFIGURATION.selfSignedCertificates=true
+
+http.server.services=SECURED-CONFIG
+
+http.server.services.SECURED-CONFIG.host=${envd:TELEMETRY_HOST}
+http.server.services.SECURED-CONFIG.port=9696
+http.server.services.SECURED-CONFIG.userName=${envd:TELEMETRY_USER}
+http.server.services.SECURED-CONFIG.password=${envd:TELEMETRY_PASSWORD}
+http.server.services.SECURED-CONFIG.restPackages=org.onap.policy.drools.server.restful
+http.server.services.SECURED-CONFIG.managed=false
+http.server.services.SECURED-CONFIG.swagger=true
+http.server.services.SECURED-CONFIG.https=true
+http.server.services.SECURED-CONFIG.aaf=${envd:AAF:false}
+http.server.services.SECURED-CONFIG.serialization.provider=org.onap.policy.common.gson.JacksonHandler,org.onap.policy.common.endpoints.http.server.YamlJacksonHandler
+
+aaf.namespace=${envd:AAF_NAMESPACE:false}
+aaf.root.permission=${envd:AAF_NAMESPACE:org.onap.policy}.pdpd
+
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/feature-lifecycle.properties b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/feature-lifecycle.properties
new file mode 100644 (file)
index 0000000..2ce112e
--- /dev/null
@@ -0,0 +1,40 @@
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+
+lifecycle.pdp.group=${envd:POLICY_PDP_PAP_GROUP:defaultGroup}
+lifecycle.pdp.type=${envd:POLICY_PDP_PAP_TYPE:drools}
+
+# Mandatory policy types that this PDP-D must support at a minimum
+lifecycle.pdp.policytypes=${envd:POLICY_PDP_PAP_POLICYTYPES}
+
+dmaap.source.topics=POLICY-PDP-PAP
+dmaap.sink.topics=POLICY-PDP-PAP
+
+dmaap.source.topics.POLICY-PDP-PAP.servers=${envd:DMAAP_SERVERS}
+dmaap.source.topics.POLICY-PDP-PAP.effectiveTopic=${envd:POLICY_PDP_PAP_TOPIC}
+dmaap.source.topics.POLICY-PDP-PAP.apiKey=${envd:POLICY_PDP_PAP_API_KEY}
+dmaap.source.topics.POLICY-PDP-PAP.apiSecret=${envd:POLICY_PDP_PAP_API_SECRET}
+dmaap.source.topics.POLICY-PDP-PAP.https=true
+dmaap.source.topics.POLICY-PDP-PAP.selfSignedCertificates=true
+
+dmaap.sink.topics.POLICY-PDP-PAP.servers=${envd:DMAAP_SERVERS}
+dmaap.sink.topics.POLICY-PDP-PAP.effectiveTopic=${envd:POLICY_PDP_PAP_TOPIC}
+dmaap.sink.topics.POLICY-PDP-PAP.apiKey=${envd:POLICY_PDP_PAP_API_KEY}
+dmaap.sink.topics.POLICY-PDP-PAP.apiSecret=${envd:POLICY_PDP_PAP_API_SECRET}
+dmaap.sink.topics.POLICY-PDP-PAP.https=true
+dmaap.sink.topics.POLICY-PDP-PAP.selfSignedCertificates=true
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/features.pre.sh b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/features.pre.sh
new file mode 100755 (executable)
index 0000000..fd7b5b9
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+# ============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=====================================================
+
+sh -c "features disable distributed-locking"
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/standalone-settings.xml b/docker-compose/docker-compose-policy-framework/config/drools-apps/custom/standalone-settings.xml
new file mode 100644 (file)
index 0000000..ebd6dd2
--- /dev/null
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  Base Package
+  ================================================================================
+  Copyright (C) 2017-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=========================================================
+  -->
+
+
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
+
+    <offline>true</offline>
+
+    <profiles>
+
+        <profile>
+            <id>policy-local</id>
+
+            <repositories>
+                <repository>
+                    <id>file-repository</id>
+                    <url>file:${user.home}/.m2/file-repository</url>
+                    <releases>
+                        <enabled>true</enabled>
+                        <updatePolicy>always</updatePolicy>
+                    </releases>
+                    <snapshots>
+                        <enabled>true</enabled>
+                        <updatePolicy>always</updatePolicy>
+                    </snapshots>
+                </repository>
+            </repositories>
+
+        </profile>
+
+    </profiles>
+
+    <activeProfiles>
+        <activeProfile>policy-local</activeProfile>
+    </activeProfiles>
+
+</settings>
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/env/base.conf b/docker-compose/docker-compose-policy-framework/config/drools-apps/env/base.conf
new file mode 100644 (file)
index 0000000..9c0d159
--- /dev/null
@@ -0,0 +1,132 @@
+# ============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====================================================
+
+# JVM options
+
+JVM_OPTIONS=-server -Xms512m -Xmx512m
+
+# SYSTEM software configuration
+
+DEBUG=y
+POLICY_HOME=/opt/app/policy
+POLICY_LOGS=/var/log/onap/policy/pdpd
+KEYSTORE_PASSWD=Pol1cy_0nap
+TRUSTSTORE_PASSWD=Pol1cy_0nap
+
+# Telemetry credentials
+
+TELEMETRY_PORT=9696
+TELEMETRY_HOST=0.0.0.0
+TELEMETRY_USER=demo@people.osaaf.org
+TELEMETRY_PASSWORD=demo123456!
+
+# nexus repository
+
+SNAPSHOT_REPOSITORY_ID=
+SNAPSHOT_REPOSITORY_URL=
+RELEASE_REPOSITORY_ID=
+RELEASE_REPOSITORY_URL=
+REPOSITORY_USERNAME=
+REPOSITORY_PASSWORD=
+REPOSITORY_OFFLINE=true
+
+# Relational (SQL) DB access
+
+SQL_HOST=mariadb
+SQL_USER=policy_user
+SQL_PASSWORD=policy_user
+
+# AAF
+
+AAF=false
+AAF_NAMESPACE=org.onap.policy
+AAF_HOST=aaf.api.simpledemo.onap.org
+
+# PDP-D DMaaP configuration channel
+
+PDPD_CONFIGURATION_TOPIC=PDPD-CONFIGURATION
+PDPD_CONFIGURATION_API_KEY=
+PDPD_CONFIGURATION_API_SECRET=
+PDPD_CONFIGURATION_CONSUMER_GROUP=
+PDPD_CONFIGURATION_CONSUMER_INSTANCE=
+PDPD_CONFIGURATION_PARTITION_KEY=
+
+# PAP-PDP configuration channel
+
+POLICY_PDP_PAP_TOPIC=POLICY-PDP-PAP
+POLICY_PDP_PAP_API_KEY=
+POLICY_PDP_PAP_API_SECRET=
+
+# PAP
+
+PAP_HOST=pap
+PAP_USERNAME=testpap
+PAP_PASSWORD=alpha123
+
+# PDP-X
+
+GUARD_DISABLED=false
+PDP_HOST=policy-xacml-pdp
+PDP_PORT=6969
+PDP_CONTEXT_URI=policy/pdpx/v1/
+PDP_USERNAME=healthcheck
+PDP_PASSWORD=zb!XztG34
+PDP_CLIENT_USERNAME=python
+PDP_CLIENT_PASSWORD=test
+PDP_ENVIRONMENT=TEST
+
+# DCAE DMaaP
+
+DCAE_TOPIC=unauthenticated.DCAE_CL_OUTPUT
+DCAE_SERVERS=policy.api.simpledemo.onap.org
+DCAE_CONSUMER_GROUP=dcae.policy.shared
+
+# Open DMaaP
+
+DMAAP_SERVERS=dmaap-mr
+
+# AAI
+
+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=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=policy.api.simpledemo.onap.org
+VFC_PORT=6670
+VFC_CONTEXT_URI=
+VFC_USERNAME=
+VFC_PASSWORD=
+
+# SDNC
+
+SDNC_HOST=policy.api.simpledemo.onap.org
+SDNC_PORT=6668
+SDNC_CONTEXT_URI=
+SDNC_USERNAME=
+SDNC_PASSWORD=
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/env/feature-healthcheck.conf b/docker-compose/docker-compose-policy-framework/config/drools-apps/env/feature-healthcheck.conf
new file mode 100644 (file)
index 0000000..1c71054
--- /dev/null
@@ -0,0 +1,18 @@
+# ============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=========================================================
+
+HEALTHCHECK_USER=demo@people.osaaf.org
+HEALTHCHECK_PASSWORD=demo123456!
diff --git a/docker-compose/docker-compose-policy-framework/config/drools-apps/env/feature-pooling-dmaap.conf b/docker-compose/docker-compose-policy-framework/config/drools-apps/env/feature-pooling-dmaap.conf
new file mode 100644 (file)
index 0000000..3808e3d
--- /dev/null
@@ -0,0 +1,17 @@
+# ============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=========================================================
+
+POOLING_TOPIC=POOLING
diff --git a/docker-compose/docker-compose-policy-framework/config/drools/custom/engine-system.properties b/docker-compose/docker-compose-policy-framework/config/drools/custom/engine-system.properties
new file mode 100644 (file)
index 0000000..19e03b5
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+#
+
+# system properties set within the application
+
+java.net.preferIPv4Stack=true
+
+# jmx
+
+com.sun.management.jmxremote.port=9991
+com.sun.management.jmxremote.authenticate=false
+com.sun.management.jmxremote.ssl=false
+
+# certs
+
+javax.net.ssl.trustStore=${envd:TRUSTSTORE:/opt/app/policy/etc/ssl/policy-truststore}
+javax.net.ssl.trustStorePassword=${envd:TRUSTSTORE_PASSWD:Pol1cy_0nap}
+
+javax.net.ssl.keyStore=${envd:KEYSTORE:/opt/app/policy/etc/ssl/policy-keystore}
+javax.net.ssl.keyStorePassword=${envd:KEYSTORE_PASSWD:Pol1cy_0nap}
+
+# kie
+
+kie.maven.offline.force=${envd:REPOSITORY_OFFLINE:false}
+
+# symmetric key for sensitive configuration data
+
+engine.symm.key=${envd:SYMM_KEY}
diff --git a/docker-compose/docker-compose-policy-framework/config/drools/custom/engine.properties b/docker-compose/docker-compose-policy-framework/config/drools/custom/engine.properties
new file mode 100644 (file)
index 0000000..dfc6a7d
--- /dev/null
@@ -0,0 +1,37 @@
+###
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 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=========================================================
+###
+
+# Policy Engine Telemetry Server
+
+http.server.services=SECURED-CONFIG
+
+http.server.services.SECURED-CONFIG.host=${envd:TELEMETRY_HOST}
+http.server.services.SECURED-CONFIG.port=9696
+http.server.services.SECURED-CONFIG.userName=${envd:TELEMETRY_USER}
+http.server.services.SECURED-CONFIG.password=${envd:TELEMETRY_PASSWORD}
+http.server.services.SECURED-CONFIG.restPackages=org.onap.policy.drools.server.restful
+http.server.services.SECURED-CONFIG.managed=false
+http.server.services.SECURED-CONFIG.swagger=true
+http.server.services.SECURED-CONFIG.https=true
+http.server.services.SECURED-CONFIG.aaf=${envd:AAF:false}
+http.server.services.SECURED-CONFIG.serialization.provider=org.onap.policy.common.gson.JacksonHandler,org.onap.policy.common.endpoints.http.server.YamlJacksonHandler
+
+aaf.namespace=${envd:AAF_NAMESPACE:false}
+aaf.root.permission=${envd:AAF_NAMESPACE:org.onap.policy}.pdpd
diff --git a/docker-compose/docker-compose-policy-framework/config/drools/custom/noop.pre.sh b/docker-compose/docker-compose-policy-framework/config/drools/custom/noop.pre.sh
new file mode 100755 (executable)
index 0000000..63bdc4c
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash -x
+# ============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=========================================================
+
+sed -i "s/^dmaap/noop/g" \
+    ${POLICY_HOME}/config/engine.properties \
+    ${POLICY_HOME}/config/feature-lifecycle.properties
+
+chmod 644 ${POLICY_HOME}/config/engine.properties ${POLICY_HOME}/config/feature-lifecycle.properties
diff --git a/docker-compose/docker-compose-policy-framework/config/drools/env/base.conf b/docker-compose/docker-compose-policy-framework/config/drools/env/base.conf
new file mode 100644 (file)
index 0000000..891de49
--- /dev/null
@@ -0,0 +1,132 @@
+# ============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=========================================================
+
+# JVM options
+
+JVM_OPTIONS=-server -Xms512m -Xmx512m
+
+# SYSTEM software configuration
+
+DEBUG=y
+POLICY_HOME=/opt/app/policy
+POLICY_LOGS=/var/log/onap/policy/pdpd
+KEYSTORE_PASSWD=Pol1cy_0nap
+TRUSTSTORE_PASSWD=Pol1cy_0nap
+
+# Telemetry credentials
+
+TELEMETRY_PORT=9696
+TELEMETRY_HOST=0.0.0.0
+TELEMETRY_USER=demo@people.osaaf.org
+TELEMETRY_PASSWORD=demo123456!
+
+# nexus repository
+
+SNAPSHOT_REPOSITORY_ID=policy-nexus-snapshots
+SNAPSHOT_REPOSITORY_URL=http://nexus:8081/nexus/content/repositories/snapshots/
+RELEASE_REPOSITORY_ID=policy-nexus-releases
+RELEASE_REPOSITORY_URL=http://nexus:8081/nexus/content/repositories/releases/
+REPOSITORY_USERNAME=admin
+REPOSITORY_PASSWORD=admin123
+REPOSITORY_OFFLINE=false
+
+# Relational (SQL) DB access
+
+SQL_HOST=mariadb
+SQL_USER=policy_user
+SQL_PASSWORD=policy_user
+
+# AAF
+
+AAF=false
+AAF_NAMESPACE=org.onap.policy
+AAF_HOST=aaf.api.simpledemo.onap.org
+
+# PDP-D DMaaP configuration channel
+
+PDPD_CONFIGURATION_TOPIC=PDPD-CONFIGURATION
+PDPD_CONFIGURATION_API_KEY=
+PDPD_CONFIGURATION_API_SECRET=
+PDPD_CONFIGURATION_CONSUMER_GROUP=
+PDPD_CONFIGURATION_CONSUMER_INSTANCE=
+PDPD_CONFIGURATION_PARTITION_KEY=
+
+# PAP-PDP configuration channel
+
+POLICY_PDP_PAP_TOPIC=POLICY-PDP-PAP
+POLICY_PDP_PAP_API_KEY=
+POLICY_PDP_PAP_API_SECRET=
+
+# PAP
+
+PAP_HOST=
+PAP_USERNAME=
+PAP_PASSWORD=
+
+# PDP-X
+
+PDP_HOST=
+PDP_PORT=
+PDP_CONTEXT_URI=policy/pdpx/v1/
+PDP_USERNAME=
+PDP_PASSWORD=
+PDP_CLIENT_USERNAME=
+PDP_CLIENT_PASSWORD=
+PDP_ENVIRONMENT=
+GUARD_DISABLED=false
+
+# DCAE DMaaP
+
+DCAE_TOPIC=unauthenticated.DCAE_CL_OUTPUT
+DCAE_SERVERS=
+DCAE_CONSUMER_GROUP=dcae.policy.shared
+
+# Open DMaaP
+
+DMAAP_SERVERS=mr.api.simpledemo.onap.org
+
+# AAI
+
+AAI_HOST=aai.api.simpledemo.onap.org
+AAI_PORT=8443
+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_USERNAME=InfraPortalClient
+SO_PASSWORD=password1$
+
+# VFC
+
+VFC_HOST=
+VFC_PORT=
+VFC_CONTEXT_URI=api/nslcm/v1/
+VFC_USERNAME=
+VFC_PASSWORD=
+
+# SDNC
+
+SDNC_HOST=
+SDNC_PORT=
+SDNC_CONTEXT_URI=restconf/operations/
+SDNC_USERNAME=
+SDNC_PASSWORD=
diff --git a/docker-compose/docker-compose-policy-framework/config/pap/defaultConfig.json b/docker-compose/docker-compose-policy-framework/config/pap/defaultConfig.json
new file mode 100644 (file)
index 0000000..8bce2d5
--- /dev/null
@@ -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": "policy_user",
+        "persistenceUnit": "PolicyMariaDb"
+    },
+    "topicParameterGroup": {
+        "topicSources" : [{
+            "topic" : "POLICY-PDP-PAP",
+            "servers" : [ "dmaap-mr" ],
+            "topicCommInfrastructure" : "dmaap",
+            "useHttps": false,
+            "allowSelfSignedCerts" : true
+        }],
+        "topicSinks" : [{
+            "topic" : "POLICY-PDP-PAP",
+            "servers" : [ "dmaap-mr" ],
+            "topicCommInfrastructure" : "dmaap",
+            "useHttps": false,
+            "allowSelfSignedCerts" : true
+        },
+        {
+            "topic" : "POLICY-NOTIFICATION",
+            "servers" : [ "dmaap-mr" ],
+            "topicCommInfrastructure" : "dmaap",
+            "useHttps": false,
+            "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/docker-compose/docker-compose-policy-framework/config/xacml-pdp/defaultConfig.json b/docker-compose/docker-compose-policy-framework/config/xacml-pdp/defaultConfig.json
new file mode 100644 (file)
index 0000000..7dc401f
--- /dev/null
@@ -0,0 +1,39 @@
+{
+    "name": "XacmlPdpParameters",
+    "pdpGroup": "defaultGroup",
+    "pdpType": "xacml",
+    "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",
+        "useHttps": true,
+        "allowSelfSignedCerts" : true,
+        "aaf": false
+    },
+    "applicationPath": "/opt/app/policy/pdpx/apps",
+    "topicParameterGroup": {
+        "topicSources" : [{
+            "topic" : "POLICY-PDP-PAP",
+            "servers" : [ "dmaap-mr" ],
+            "topicCommInfrastructure" : "dmaap",
+            "useHttps" : false,
+            "allowSelfSignedCerts" : true
+        }],
+        "topicSinks" : [{
+            "topic" : "POLICY-PDP-PAP",
+            "servers" : [ "dmaap-mr" ],
+            "topicCommInfrastructure" : "dmaap",
+            "useHttps" : false,
+            "allowSelfSignedCerts" : true
+        }]
+    }
+}
diff --git a/docker-compose/docker-compose-policy-framework/docker-compose.yml b/docker-compose/docker-compose-policy-framework/docker-compose.yml
new file mode 100644 (file)
index 0000000..4cdde39
--- /dev/null
@@ -0,0 +1,189 @@
+#
+# ===========LICENSE_START====================================================
+#  Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+#  Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
+#  Modifications Copyright (C) 2021 Nordix Foundation. 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'
+networks:
+  default:
+    driver: bridge
+    name: nonrtric-docker-net
+services:
+   mariadb:
+      image: nexus3.onap.org:10001/mariadb:10.5.8
+      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
+   api:
+      image: nexus3.onap.org:10001/onap/policy-api:2.4.2
+      container_name: policy-api
+      depends_on:
+       - mariadb
+      hostname: policy-api
+      ports:
+       - "6969:6969"
+      expose:
+       - 6969
+      volumes:
+       - ./config/ks.jks:/opt/app/policy/api/etc/ssl/policy-keystore.jks:ro
+       - ./wait_for_port.sh:/opt/app/policy/api/bin/wait_for_port.sh:ro
+      entrypoint: ./wait_for_port.sh
+      command: [
+        '-c', './policy-api.sh',
+        'mariadb', '3306'
+        ]
+   pap:
+      image: nexus3.onap.org:10001/onap/policy-pap:2.4.2
+      container_name: policy-pap
+      depends_on:
+       - mariadb
+       - api
+      hostname: policy-pap
+      ports:
+       - "6868:6969"
+      expose:
+       - 6868
+      volumes:
+       - ./config/pap/defaultConfig.json:/opt/app/policy/pap/etc/defaultConfig.json:ro
+       - ./config/ks.jks:/opt/app/policy/pap/etc/ssl/policy-keystore.jks:ro
+       - ./wait_for_port.sh:/opt/app/policy/pap/bin/wait_for_port.sh:ro
+      entrypoint: ./wait_for_port.sh
+      command: [
+        '-c', './policy-pap.sh',
+        'mariadb', '3306',
+        'dmaap-mr', '3904',
+        'api', '6969'
+        ]
+   xacml-pdp:
+      image: nexus3.onap.org:10001/onap/policy-xacml-pdp:2.4.2
+      container_name: policy-xacml-pdp
+      depends_on:
+       - mariadb
+       - pap
+      hostname: policy-xacml-pdp
+      expose:
+       - 6969
+      volumes:
+       - ./config/xacml-pdp/defaultConfig.json:/opt/app/policy/pdpx/etc/defaultConfig.json:ro
+       - ./config/ks.jks:/opt/app/policy/pdpx/etc/ssl/policy-keystore.jks:ro
+       - ./wait_for_port.sh:/opt/app/policy/pdpx/bin/wait_for_port.sh:ro
+      entrypoint: ./wait_for_port.sh
+      command: [
+        '-c', './policy-pdpx.sh',
+        'mariadb', '3306',
+        'dmaap-mr', '3904',
+        'pap', '6969'
+        ]
+   drools:
+      image: nexus3.onap.org:10001/onap/policy-drools:1.8.2
+      container_name: drools
+      depends_on:
+       - mariadb
+       - pap
+      hostname: drools
+      expose:
+       - 6969
+       - 9696
+      volumes:
+       - ./config/drools/custom:/tmp/policy-install/config:ro
+       - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
+      env_file:
+        - config/drools/env/base.conf
+      entrypoint: /opt/app/policy/bin/wait_for_port.sh
+      command: [
+        '-c', '/opt/app/policy/bin/pdpd-entrypoint.sh boot',
+        'mariadb', '3306',
+        'dmaap-mr', '3904'
+        ]
+   drools-apps:
+      image: nexus3.onap.org:10001/onap/policy-pdpd-cl:1.8.2
+      container_name: drools-apps
+      depends_on:
+       - mariadb
+       - pap
+       - xacml-pdp
+      hostname: drools-apps
+      expose:
+       - 6969
+       - 9696
+      volumes:
+       - ./config/drools-apps/custom:/tmp/policy-install/config:ro
+       - ./config/drools-apps/custom/feature-lifecycle.properties:/opt/app/policy/features/lifecycle/config/feature-lifecycle.properties:ro
+       - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
+      env_file:
+        - config/drools-apps/env/base.conf
+        - config/drools-apps/env/feature-healthcheck.conf
+        - config/drools-apps/env/feature-pooling-dmaap.conf
+      entrypoint: /opt/app/policy/bin/wait_for_port.sh
+      command: [
+        '-c', '/opt/app/policy/bin/pdpd-cl-entrypoint.sh boot',
+        'mariadb', '3306',
+        'dmaap-mr', '3904',
+        'pap', '6969',
+        'dmaap-mr', '6666',
+        'dmaap-mr', '6668',
+        'dmaap-mr', '6669',
+        'dmaap-mr', '6670'
+        ]
+   apex-pdp:
+      image: onap/policy-apex-pdp:latest
+      container_name: policy-apex-pdp
+      depends_on:
+       - mariadb
+       - pap
+      hostname: policy-apex-pdp
+      expose:
+       - 6969
+       - 23324
+      volumes:
+       - ./config/apex-pdp/OnapPfConfig.json:/opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json:ro
+       - ./config/ks.jks:/opt/app/policy/apex-pdp/etc/ssl/policy-keystore.jks:ro
+       - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
+      entrypoint: /opt/app/policy/bin/wait_for_port.sh
+      command: [
+        '-c', '/opt/app/policy/apex-pdp/bin/apexOnapPf.sh -c /opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json',
+        'mariadb', '3306',
+        'dmaap-mr', '3904',
+        'pap', '6969'
+        ]
+   distribution:
+      image: nexus3.onap.org:10001/onap/policy-distribution:2.5.2
+      container_name: policy-distribution
+      depends_on:
+       - mariadb
+       - api
+       - pap
+       - apex-pdp
+      hostname: policy-distribution
+      volumes:
+       - ./config/distribution/defaultConfig.json:/opt/app/policy/distribution/etc/defaultConfig.json:ro
+       - ./config/ks.jks:/opt/app/policy/distribution/etc/ssl/policy-keystore.jks:ro
+       - ./distribution/config/temp/:/opt/app/policy/distribution/etc/temp/:ro
+       - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
+      entrypoint: /opt/app/policy/bin/wait_for_port.sh
+      command: [
+        '-c', './policy-dist.sh',
+        'mariadb', '3306',
+        'dmaap-mr', '3904',
+        'pap', '6969',
+        'apex-pdp', '6969'
+        ]
index a285320..2cc26f8 100644 (file)
                         "parameterClassName": "org.onap.policy.apex.plugins.context.schema.avro.AvroSchemaHelperParameters"
                     }
                 }
-            }
+            },
+            "taskParameters": [
+                {
+                    "key": "ORU-ODU-Map",
+                    "value": "{\"ERICSSON-O-RU-11220\": \"HCL-O-DU-1122\",
+                               \"ERICSSON-O-RU-11221\": \"HCL-O-DU-1122\",
+                               \"ERICSSON-O-RU-11222\": \"HCL-O-DU-1122\",
+                               \"ERICSSON-O-RU-11223\": \"HCL-O-DU-1122\",
+                               \"ERICSSON-O-RU-11224\": \"HCL-O-DU-1123\",
+                               \"ERICSSON-O-RU-11225\": \"HCL-O-DU-1123\",
+                               \"ERICSSON-O-RU-11226\": \"HCL-O-DU-1123\",
+                               \"ERICSSON-O-RU-11227\": \"HCL-O-DU-1124\",
+                               \"ERICSSON-O-RU-11228\": \"HCL-O-DU-1125\",
+                               \"ERICSSON-O-RU-11229\": \"HCL-O-DU-1125\"}"
+                }
+            ]
         }
     },
     "eventOutputParameters": {
diff --git a/test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/config/o-ru-to-o-du-map.json b/test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/config/o-ru-to-o-du-map.json
deleted file mode 100644 (file)
index a72ed6b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-    "ERICSSON-O-RU-11220": "HCL-O-DU-1122",
-    "ERICSSON-O-RU-11221": "HCL-O-DU-1122",
-    "ERICSSON-O-RU-11222": "HCL-O-DU-1122",
-    "ERICSSON-O-RU-11223": "HCL-O-DU-1122",
-    "ERICSSON-O-RU-11223": "HCL-O-DU-1122",
-    "ERICSSON-O-RU-11224": "HCL-O-DU-1123",
-    "ERICSSON-O-RU-11225": "HCL-O-DU-1123",
-    "ERICSSON-O-RU-11226": "HCL-O-DU-1123",
-    "ERICSSON-O-RU-11227": "HCL-O-DU-1124",
-    "ERICSSON-O-RU-11228": "HCL-O-DU-1125",
-    "ERICSSON-O-RU-11229": "HCL-O-DU-1125"
-}
\ No newline at end of file
diff --git a/test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/deployment/DeployPolicyPAP.json b/test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/deployment/DeployPolicyPAP.json
new file mode 100644 (file)
index 0000000..6d9bde5
--- /dev/null
@@ -0,0 +1,8 @@
+{
+  "policies": [
+    {
+      "policy-id": "onap.policies.native.apex.LinkMonitor",
+      "policy-version": "1.0.0"
+    }
+  ]
+}
\ No newline at end of file
diff --git a/test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/deployment/ToscaPolicy.json b/test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/deployment/ToscaPolicy.json
new file mode 100644 (file)
index 0000000..b80035a
--- /dev/null
@@ -0,0 +1 @@
+{"tosca_definitions_version":"tosca_simple_yaml_1_1_0","topology_template":{"policies":[{"onap.policies.native.apex.LinkMonitor":{"type":"onap.policies.native.Apex","type_version":"1.0.0","name":"onap.policies.native.apex.LinkMonitor","version":"1.0.0","properties":{"engineServiceParameters":{"name":"LinkMonitorApexEngine","version":"0.0.1","id":101,"instanceCount":1,"deploymentPort":12345,"engineParameters":{"executorParameters":{"JAVASCRIPT":{"parameterClassName":"org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters"}},"contextParameters":{"parameterClassName":"org.onap.policy.apex.context.parameters.ContextParameters","schemaParameters":{"Avro":{"parameterClassName":"org.onap.policy.apex.plugins.context.schema.avro.AvroSchemaHelperParameters"}}},"taskParameters":[{"key":"ORU-ODU-Map","value":"{\"ERICSSON-O-RU-11220\": \"HCL-O-DU-1122\",\n                               \"ERICSSON-O-RU-11221\": \"HCL-O-DU-1122\",\n                               \"ERICSSON-O-RU-11222\": \"HCL-O-DU-1122\",\n                               \"ERICSSON-O-RU-11223\": \"HCL-O-DU-1122\",\n                               \"ERICSSON-O-RU-11224\": \"HCL-O-DU-1123\",\n                               \"ERICSSON-O-RU-11225\": \"HCL-O-DU-1123\",\n                               \"ERICSSON-O-RU-11226\": \"HCL-O-DU-1123\",\n                               \"ERICSSON-O-RU-11227\": \"HCL-O-DU-1124\",\n                               \"ERICSSON-O-RU-11228\": \"HCL-O-DU-1125\",\n                               \"ERICSSON-O-RU-11229\": \"HCL-O-DU-1125\"}"}]},"policy_type_impl":{"apexPolicyModel":{"key":{"name":"LinkMonitorModel","version":"0.0.1"},"keyInformation":{"key":{"name":"LinkMonitorModel_KeyInfo","version":"0.0.1"},"keyInfoMap":{"entry":[{"key":{"name":"ApexMessageOutputEvent","version":"0.0.1"},"value":{"key":{"name":"ApexMessageOutputEvent","version":"0.0.1"},"UUID":"cca47d74-7754-4a61-b163-ca31f66b157b","description":"Generated description for concept referred to by key \"ApexMessageOutputEvent:0.0.1\""}},{"key":{"name":"CreateLinkClearedOutfieldsEvent","version":"0.0.1"},"value":{"key":{"name":"CreateLinkClearedOutfieldsEvent","version":"0.0.1"},"UUID":"a295d6a3-1b73-387e-abba-b41e9b608802","description":"Generated description for concept referred to by key \"CreateLinkClearedOutfieldsEvent:0.0.1\""}},{"key":{"name":"CreateLinkClearedOutfieldsTask","version":"0.0.1"},"value":{"key":{"name":"CreateLinkClearedOutfieldsTask","version":"0.0.1"},"UUID":"fd594e88-411d-4a94-b2be-697b3a0d7adf","description":"This task creates the output fields when link failure is cleared."}},{"key":{"name":"CreateLinkFailureOutfieldsEvent","version":"0.0.1"},"value":{"key":{"name":"CreateLinkFailureOutfieldsEvent","version":"0.0.1"},"UUID":"02be2b5d-45b7-3c54-ae54-97f2b5c30125","description":"Generated description for concept referred to by key \"CreateLinkFailureOutfieldsEvent:0.0.1\""}},{"key":{"name":"CreateLinkFailureOutfieldsTask","version":"0.0.1"},"value":{"key":{"name":"CreateLinkFailureOutfieldsTask","version":"0.0.1"},"UUID":"ac3d9842-80af-4a98-951c-bd79a431c613","description":"This task the output fields when link failure is detected."}},{"key":{"name":"LinkClearedTask","version":"0.0.1"},"value":{"key":{"name":"LinkClearedTask","version":"0.0.1"},"UUID":"eecfde90-896c-4343-8f9c-2603ced94e2d","description":"This task sends a message to the output when link failure is cleared."}},{"key":{"name":"LinkFailureInputEvent","version":"0.0.1"},"value":{"key":{"name":"LinkFailureInputEvent","version":"0.0.1"},"UUID":"c4500941-3f98-4080-a9cc-5b9753ed050b","description":"Generated description for concept referred to by key \"LinkFailureInputEvent:0.0.1\""}},{"key":{"name":"LinkFailureInputSchema","version":"0.0.1"},"value":{"key":{"name":"LinkFailureInputSchema","version":"0.0.1"},"UUID":"3b3974fc-3012-3b02-9f33-c9d8eefe4dc1","description":"Generated description for concept referred to by key \"LinkFailureInputSchema:0.0.1\""}},{"key":{"name":"LinkFailureOutputEvent","version":"0.0.1"},"value":{"key":{"name":"LinkFailureOutputEvent","version":"0.0.1"},"UUID":"4f04aa98-e917-4f4a-882a-c75ba5a99374","description":"Generated description for concept referred to by key \"LinkFailureOutputEvent:0.0.1\""}},{"key":{"name":"LinkFailureOutputSchema","version":"0.0.1"},"value":{"key":{"name":"LinkFailureOutputSchema","version":"0.0.1"},"UUID":"2d1a7f6e-eb9a-3984-be1f-283d98111b84","description":"Generated description for concept referred to by key \"LinkFailureOutputSchema:0.0.1\""}},{"key":{"name":"LinkFailureTask","version":"0.0.1"},"value":{"key":{"name":"LinkFailureTask","version":"0.0.1"},"UUID":"3351b0f4-cf06-4fa2-8823-edf67bd30223","description":"This task updates the config for O-RU when link failure is detected."}},{"key":{"name":"LinkMonitorModel","version":"0.0.1"},"value":{"key":{"name":"LinkMonitorModel","version":"0.0.1"},"UUID":"540226fb-55ee-4f0e-a444-983a0494818e","description":"This is the Apex Policy Model for link monitoring."}},{"key":{"name":"LinkMonitorModel_Events","version":"0.0.1"},"value":{"key":{"name":"LinkMonitorModel_Events","version":"0.0.1"},"UUID":"27ad3e7e-fe3b-3bd6-9081-718705c2bcea","description":"Generated description for concept referred to by key \"LinkMonitorModel_Events:0.0.1\""}},{"key":{"name":"LinkMonitorModel_KeyInfo","version":"0.0.1"},"value":{"key":{"name":"LinkMonitorModel_KeyInfo","version":"0.0.1"},"UUID":"ea0b5f58-eefd-358a-9660-840c640bf981","description":"Generated description for concept referred to by key \"LinkMonitorModel_KeyInfo:0.0.1\""}},{"key":{"name":"LinkMonitorModel_Policies","version":"0.0.1"},"value":{"key":{"name":"LinkMonitorModel_Policies","version":"0.0.1"},"UUID":"ee9e0b0f-2b7d-3ab7-9a98-c5ec05ed823d","description":"Generated description for concept referred to by key \"LinkMonitorModel_Policies:0.0.1\""}},{"key":{"name":"LinkMonitorModel_Schemas","version":"0.0.1"},"value":{"key":{"name":"LinkMonitorModel_Schemas","version":"0.0.1"},"UUID":"fa5f9b8f-796c-3c70-84e9-5140c958c4bb","description":"Generated description for concept referred to by key \"LinkMonitorModel_Schemas:0.0.1\""}},{"key":{"name":"LinkMonitorModel_Tasks","version":"0.0.1"},"value":{"key":{"name":"LinkMonitorModel_Tasks","version":"0.0.1"},"UUID":"eec592f7-69d5-39a9-981a-e552f787ed01","description":"Generated description for concept referred to by key \"LinkMonitorModel_Tasks:0.0.1\""}},{"key":{"name":"LinkMonitorPolicy","version":"0.0.1"},"value":{"key":{"name":"LinkMonitorPolicy","version":"0.0.1"},"UUID":"6c5e410f-489a-46ff-964e-982ce6e8b6d0","description":"Generated description for concept referred to by key \"LinkMonitorPolicy:0.0.1\""}},{"key":{"name":"MessageSchema","version":"0.0.1"},"value":{"key":{"name":"MessageSchema","version":"0.0.1"},"UUID":"ac4b34ac-39d6-3393-a267-8d5b84854018","description":"A schema for messages from apex"}},{"key":{"name":"NoPolicyDefinedTask","version":"0.0.1"},"value":{"key":{"name":"NoPolicyDefinedTask","version":"0.0.1"},"UUID":"d48b619e-d00d-4008-b884-02d76ea4350b","description":"This task sends a message to the output when an event is received for which no policy has been defined."}},{"key":{"name":"OduIdSchema","version":"0.0.1"},"value":{"key":{"name":"OduIdSchema","version":"0.0.1"},"UUID":"50662174-a88b-3cbd-91bd-8e91b40b2660","description":"A schema for O-DU-ID"}},{"key":{"name":"OruIdSchema","version":"0.0.1"},"value":{"key":{"name":"OruIdSchema","version":"0.0.1"},"UUID":"54daf32b-015f-39cd-8530-a1175c5553e9","description":"A schema for O-RU-ID"}}]}},"policies":{"key":{"name":"LinkMonitorModel_Policies","version":"0.0.1"},"policyMap":{"entry":[{"key":{"name":"LinkMonitorPolicy","version":"0.0.1"},"value":{"policyKey":{"name":"LinkMonitorPolicy","version":"0.0.1"},"template":"Freestyle","state":{"entry":[{"key":"LinkClearedState","value":{"stateKey":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"NULL","localName":"LinkClearedState"},"trigger":{"name":"CreateLinkClearedOutfieldsEvent","version":"0.0.1"},"stateOutputs":{"entry":[{"key":"LinkClearedLogic_Output_Direct","value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkClearedState","localName":"LinkClearedLogic_Output_Direct"},"outgoingEvent":{"name":"ApexMessageOutputEvent","version":"0.0.1"},"nextState":{"parentKeyName":"NULL","parentKeyVersion":"0.0.0","parentLocalName":"NULL","localName":"NULL"}}}]},"contextAlbumReference":[],"taskSelectionLogic":{"key":"NULL","logicFlavour":"UNDEFINED","logic":""},"stateFinalizerLogicMap":{"entry":[]},"defaultTask":{"name":"LinkClearedTask","version":"0.0.1"},"taskReferences":{"entry":[{"key":{"name":"LinkClearedTask","version":"0.0.1"},"value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkClearedState","localName":"LinkClearedTask"},"outputType":"DIRECT","output":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkClearedState","localName":"LinkClearedLogic_Output_Direct"}}}]}}},{"key":"LinkFailureOrClearedState","value":{"stateKey":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"NULL","localName":"LinkFailureOrClearedState"},"trigger":{"name":"LinkFailureInputEvent","version":"0.0.1"},"stateOutputs":{"entry":[{"key":"CreateLinkClearedOutfieldsLogic_Output_Direct","value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"CreateLinkClearedOutfieldsLogic_Output_Direct"},"outgoingEvent":{"name":"CreateLinkClearedOutfieldsEvent","version":"0.0.1"},"nextState":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"NULL","localName":"LinkClearedState"}}},{"key":"CreateLinkFailureOutfieldsLogic_Output_Direct","value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"CreateLinkFailureOutfieldsLogic_Output_Direct"},"outgoingEvent":{"name":"CreateLinkFailureOutfieldsEvent","version":"0.0.1"},"nextState":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"NULL","localName":"LinkFailureState"}}},{"key":"NoPolicyDefinedLogic_Output_Direct","value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"NoPolicyDefinedLogic_Output_Direct"},"outgoingEvent":{"name":"ApexMessageOutputEvent","version":"0.0.1"},"nextState":{"parentKeyName":"NULL","parentKeyVersion":"0.0.0","parentLocalName":"NULL","localName":"NULL"}}}]},"contextAlbumReference":[],"taskSelectionLogic":{"key":"TaskSelectionLogic","logicFlavour":"JAVASCRIPT","logic":"/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2021 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(\"Task Selection Execution: '\"+executor.subject.id+\n    \"'. InputFields: '\"+executor.inFields+\"'\");\n\nvar linkFailureInput = executor.inFields.get(\"LinkFailureInput\");\nvar commonEventHeader = linkFailureInput.get(\"event\").get(\"commonEventHeader\");\nvar domain = commonEventHeader.get(\"domain\");\n\ntaskFailure = executor.subject.getTaskKey(\"CreateLinkFailureOutfieldsTask\");\ntaskCleared = executor.subject.getTaskKey(\"CreateLinkClearedOutfieldsTask\");\ntaskDefault = executor.subject.getDefaultTaskKey();\n\nif (domain == \"fault\") {\n    var faultFields = linkFailureInput.get(\"event\").get(\"faultFields\");\n    var alarmCondition = faultFields.get(\"alarmCondition\");\n    var eventSeverity = faultFields.get(\"eventSeverity\");\n    if (alarmCondition == \"30\" && eventSeverity != \"NORMAL\") {\n        taskFailure.copyTo(executor.selectedTask);\n    } else if (alarmCondition == \"30\" && eventSeverity == \"NORMAL\") {\n        taskCleared.copyTo(executor.selectedTask);\n    } else {\n        taskDefault.copyTo(executor.selectedTask);\n    }\n} else {\n    taskDefault.copyTo(executor.selectedTask);\n}\n\ntrue;"},"stateFinalizerLogicMap":{"entry":[]},"defaultTask":{"name":"NoPolicyDefinedTask","version":"0.0.1"},"taskReferences":{"entry":[{"key":{"name":"CreateLinkClearedOutfieldsTask","version":"0.0.1"},"value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"CreateLinkClearedOutfieldsTask"},"outputType":"DIRECT","output":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"CreateLinkClearedOutfieldsLogic_Output_Direct"}}},{"key":{"name":"CreateLinkFailureOutfieldsTask","version":"0.0.1"},"value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"CreateLinkFailureOutfieldsTask"},"outputType":"DIRECT","output":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"CreateLinkFailureOutfieldsLogic_Output_Direct"}}},{"key":{"name":"NoPolicyDefinedTask","version":"0.0.1"},"value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"NoPolicyDefinedTask"},"outputType":"DIRECT","output":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"NoPolicyDefinedLogic_Output_Direct"}}}]}}},{"key":"LinkFailureState","value":{"stateKey":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"NULL","localName":"LinkFailureState"},"trigger":{"name":"CreateLinkFailureOutfieldsEvent","version":"0.0.1"},"stateOutputs":{"entry":[{"key":"LinkFailureLogic_Output_Direct","value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureState","localName":"LinkFailureLogic_Output_Direct"},"outgoingEvent":{"name":"LinkFailureOutputEvent","version":"0.0.1"},"nextState":{"parentKeyName":"NULL","parentKeyVersion":"0.0.0","parentLocalName":"NULL","localName":"NULL"}}}]},"contextAlbumReference":[],"taskSelectionLogic":{"key":"NULL","logicFlavour":"UNDEFINED","logic":""},"stateFinalizerLogicMap":{"entry":[]},"defaultTask":{"name":"LinkFailureTask","version":"0.0.1"},"taskReferences":{"entry":[{"key":{"name":"LinkFailureTask","version":"0.0.1"},"value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureState","localName":"LinkFailureTask"},"outputType":"DIRECT","output":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureState","localName":"LinkFailureLogic_Output_Direct"}}}]}}}]},"firstState":"LinkFailureOrClearedState"}}]}},"tasks":{"key":{"name":"LinkMonitorModel_Tasks","version":"0.0.1"},"taskMap":{"entry":[{"key":{"name":"CreateLinkClearedOutfieldsTask","version":"0.0.1"},"value":{"key":{"name":"CreateLinkClearedOutfieldsTask","version":"0.0.1"},"inputFields":{"entry":[{"key":"LinkFailureInput","value":{"key":"LinkFailureInput","fieldSchemaKey":{"name":"LinkFailureInputSchema","version":"0.0.1"},"optional":false}}]},"outputFields":{"entry":[{"key":"OruId","value":{"key":"OruId","fieldSchemaKey":{"name":"OruIdSchema","version":"0.0.1"},"optional":false}}]},"taskParameters":{"entry":[]},"contextAlbumReference":[],"taskLogic":{"key":"TaskLogic","logicFlavour":"JAVASCRIPT","logic":"/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2021 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\");\n\nvar linkFailureInput = executor.inFields.get(\"LinkFailureInput\");\nvar oruId = linkFailureInput.get(\"event\").get(\"commonEventHeader\").get(\"sourceName\");\n\nexecutor.outFields.put(\"OruId\", oruId);\n\nexecutor.logger.info(executor.outFields);\n\ntrue;"}}},{"key":{"name":"CreateLinkFailureOutfieldsTask","version":"0.0.1"},"value":{"key":{"name":"CreateLinkFailureOutfieldsTask","version":"0.0.1"},"inputFields":{"entry":[{"key":"LinkFailureInput","value":{"key":"LinkFailureInput","fieldSchemaKey":{"name":"LinkFailureInputSchema","version":"0.0.1"},"optional":false}}]},"outputFields":{"entry":[{"key":"OduId","value":{"key":"OduId","fieldSchemaKey":{"name":"OduIdSchema","version":"0.0.1"},"optional":false}},{"key":"OruId","value":{"key":"OruId","fieldSchemaKey":{"name":"OruIdSchema","version":"0.0.1"},"optional":false}}]},"taskParameters":{"entry":[]},"contextAlbumReference":[],"taskLogic":{"key":"TaskLogic","logicFlavour":"JAVASCRIPT","logic":"/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2021 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\");\n\nvar returnValue = true;\nvar linkFailureInput = executor.inFields.get(\"LinkFailureInput\");\nvar oruId = linkFailureInput.get(\"event\").get(\"commonEventHeader\").get(\"sourceName\");\nvar oruOduMap = JSON.parse(executor.parameters.get(\"ORU-ODU-Map\"));\n\nif (oruId in oruOduMap) {\n    var oduId = oruOduMap[oruId];\n    executor.outFields.put(\"OruId\", oruId);\n    executor.outFields.put(\"OduId\", oduId);\n    executor.logger.info(executor.outFields);\n} else {\n    executor.message = \"No O-RU found in the config with this ID: \" + oruId;\n    returnValue = false;\n}\n\nreturnValue;"}}},{"key":{"name":"LinkClearedTask","version":"0.0.1"},"value":{"key":{"name":"LinkClearedTask","version":"0.0.1"},"inputFields":{"entry":[{"key":"OruId","value":{"key":"OruId","fieldSchemaKey":{"name":"OruIdSchema","version":"0.0.1"},"optional":false}}]},"outputFields":{"entry":[{"key":"message","value":{"key":"message","fieldSchemaKey":{"name":"MessageSchema","version":"0.0.1"},"optional":false}}]},"taskParameters":{"entry":[]},"contextAlbumReference":[],"taskLogic":{"key":"TaskLogic","logicFlavour":"JAVASCRIPT","logic":"/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2021 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\");\n\nvar oruId = executor.inFields.get(\"OruId\");\n\nexecutor.outFields.put(\"message\", \"CLEARED link failure for O-RU: \" + oruId);\n\nexecutor.logger.info(executor.outFields);\n\ntrue;"}}},{"key":{"name":"LinkFailureTask","version":"0.0.1"},"value":{"key":{"name":"LinkFailureTask","version":"0.0.1"},"inputFields":{"entry":[{"key":"OduId","value":{"key":"OduId","fieldSchemaKey":{"name":"OduIdSchema","version":"0.0.1"},"optional":false}},{"key":"OruId","value":{"key":"OruId","fieldSchemaKey":{"name":"OruIdSchema","version":"0.0.1"},"optional":false}}]},"outputFields":{"entry":[{"key":"LinkFailureOutput","value":{"key":"LinkFailureOutput","fieldSchemaKey":{"name":"LinkFailureOutputSchema","version":"0.0.1"},"optional":false}}]},"taskParameters":{"entry":[]},"contextAlbumReference":[],"taskLogic":{"key":"TaskLogic","logicFlavour":"JAVASCRIPT","logic":"/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2021 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\");\n\nvar linkFailureOutput = executor.subject.getOutFieldSchemaHelper(\"LinkFailureOutput\").createNewInstance();\n\nvar oruId = executor.inFields.get(\"OruId\");\nvar oduId = executor.inFields.get(\"OduId\");\n\nvar unlockMessageArray = new java.util.ArrayList();\nfor (var i = 0; i < 1; i++) {\n    unlockMessageArray.add({\n        \"name\" : oruId,\n        \"administrative_DasH_state\" : \"UNLOCKED\"\n    });\n}\n\nlinkFailureOutput.put(\"o_DasH_ran_DasH_sc_DasH_du_DasH_hello_DasH_world_ColoN_du_DasH_to_DasH_ru_DasH_connection\", unlockMessageArray);\nexecutor.outFields.put(\"LinkFailureOutput\", linkFailureOutput.toString());\n\nexecutor.getExecutionProperties().setProperty(\"OduId\", oduId);\nexecutor.getExecutionProperties().setProperty(\"OruId\", oruId);\n\nexecutor.logger.info(executor.outFields);\n\ntrue;"}}},{"key":{"name":"NoPolicyDefinedTask","version":"0.0.1"},"value":{"key":{"name":"NoPolicyDefinedTask","version":"0.0.1"},"inputFields":{"entry":[{"key":"LinkFailureInput","value":{"key":"LinkFailureInput","fieldSchemaKey":{"name":"LinkFailureInputSchema","version":"0.0.1"},"optional":false}}]},"outputFields":{"entry":[{"key":"message","value":{"key":"message","fieldSchemaKey":{"name":"MessageSchema","version":"0.0.1"},"optional":false}}]},"taskParameters":{"entry":[]},"contextAlbumReference":[],"taskLogic":{"key":"TaskLogic","logicFlavour":"JAVASCRIPT","logic":"/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2021 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\");\n\nexecutor.outFields.put(\"message\", \"No policy defined for this event\");\n\nexecutor.logger.info(executor.outFields);\n\ntrue;"}}}]}},"events":{"key":{"name":"LinkMonitorModel_Events","version":"0.0.1"},"eventMap":{"entry":[{"key":{"name":"ApexMessageOutputEvent","version":"0.0.1"},"value":{"key":{"name":"ApexMessageOutputEvent","version":"0.0.1"},"nameSpace":"org.onap.policy.apex.auth.clieditor","source":"APEX","target":"APEX","parameter":{"entry":[{"key":"message","value":{"key":"message","fieldSchemaKey":{"name":"MessageSchema","version":"0.0.1"},"optional":false}}]}}},{"key":{"name":"CreateLinkClearedOutfieldsEvent","version":"0.0.1"},"value":{"key":{"name":"CreateLinkClearedOutfieldsEvent","version":"0.0.1"},"nameSpace":"org.onap.policy.apex.auth.clieditor","source":"APEX","target":"APEX","parameter":{"entry":[{"key":"OruId","value":{"key":"OruId","fieldSchemaKey":{"name":"OruIdSchema","version":"0.0.1"},"optional":false}}]}}},{"key":{"name":"CreateLinkFailureOutfieldsEvent","version":"0.0.1"},"value":{"key":{"name":"CreateLinkFailureOutfieldsEvent","version":"0.0.1"},"nameSpace":"org.onap.policy.apex.auth.clieditor","source":"APEX","target":"APEX","parameter":{"entry":[{"key":"OduId","value":{"key":"OduId","fieldSchemaKey":{"name":"OduIdSchema","version":"0.0.1"},"optional":false}},{"key":"OruId","value":{"key":"OruId","fieldSchemaKey":{"name":"OruIdSchema","version":"0.0.1"},"optional":false}}]}}},{"key":{"name":"LinkFailureInputEvent","version":"0.0.1"},"value":{"key":{"name":"LinkFailureInputEvent","version":"0.0.1"},"nameSpace":"org.onap.policy.apex.auth.clieditor","source":"DMAAP","target":"APEX","parameter":{"entry":[{"key":"LinkFailureInput","value":{"key":"LinkFailureInput","fieldSchemaKey":{"name":"LinkFailureInputSchema","version":"0.0.1"},"optional":false}}]}}},{"key":{"name":"LinkFailureOutputEvent","version":"0.0.1"},"value":{"key":{"name":"LinkFailureOutputEvent","version":"0.0.1"},"nameSpace":"org.onap.policy.apex.auth.clieditor","source":"APEX","target":"OAM","parameter":{"entry":[{"key":"LinkFailureOutput","value":{"key":"LinkFailureOutput","fieldSchemaKey":{"name":"LinkFailureOutputSchema","version":"0.0.1"},"optional":false}}]}}}]}},"schemas":{"key":{"name":"LinkMonitorModel_Schemas","version":"0.0.1"},"schemas":{"entry":[{"key":{"name":"LinkFailureInputSchema","version":"0.0.1"},"value":{"key":{"name":"LinkFailureInputSchema","version":"0.0.1"},"schemaFlavour":"Avro","schemaDefinition":"{\n    \"type\": \"record\",\n    \"name\": \"Link_Failure_Input\",\n    \"fields\": [\n        {\n            \"name\": \"event\",\n            \"type\": {\n                \"type\": \"record\",\n                \"name\": \"Event_Type\",\n                \"fields\": [\n                    {\n                        \"name\": \"commonEventHeader\",\n                        \"type\": {\n                            \"type\": \"record\",\n                            \"name\": \"Common_Event_Header_Type\",\n                            \"fields\": [\n                                {\n                                    \"name\": \"domain\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"eventId\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"eventName\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"eventType\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"sequence\",\n                                    \"type\": \"int\"\n                                },\n                                {\n                                    \"name\": \"priority\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"reportingEntityId\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"reportingEntityName\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"sourceId\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"sourceName\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"startEpochMicrosec\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"lastEpochMicrosec\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"nfNamingCode\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"nfVendorName\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"timeZoneOffset\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"version\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"vesEventListenerVersion\",\n                                    \"type\": \"string\"\n                                }\n                            ]\n                        }\n                    },\n                    {\n                        \"name\": \"faultFields\",\n                        \"type\": {\n                            \"type\": \"record\",\n                            \"name\": \"Fault_Fields_Type\",\n                            \"fields\": [\n                                {\n                                    \"name\": \"faultFieldsVersion\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"alarmCondition\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"alarmInterfaceA\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"eventSourceType\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"specificProblem\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"eventSeverity\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"vfStatus\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"alarmAdditionalInformation\",\n                                    \"type\": {\n                                        \"type\": \"record\",\n                                        \"name\": \"Alarm_Additional_Information_Type\",\n                                        \"fields\": [\n                                            {\n                                                \"name\": \"eventTime\",\n                                                \"type\": \"string\"\n                                            },\n                                            {\n                                                \"name\": \"equipType\",\n                                                \"type\": \"string\"\n                                            },\n                                            {\n                                                \"name\": \"vendor\",\n                                                \"type\": \"string\"\n                                            },\n                                            {\n                                                \"name\": \"model\",\n                                                \"type\": \"string\"\n                                            }\n                                        ]\n                                    }\n                                }\n                            ]\n                        }\n                    }\n                ]\n            }\n        }\n    ]\n}"}},{"key":{"name":"LinkFailureOutputSchema","version":"0.0.1"},"value":{"key":{"name":"LinkFailureOutputSchema","version":"0.0.1"},"schemaFlavour":"Avro","schemaDefinition":"{\n    \"type\": \"record\",\n    \"name\": \"Link_Failure_Output\",\n    \"fields\": [\n        {\n            \"name\": \"o_DasH_ran_DasH_sc_DasH_du_DasH_hello_DasH_world_ColoN_du_DasH_to_DasH_ru_DasH_connection\",\n            \"type\": {\n        \t\"type\": \"array\",\n        \t\"items\": {\n\t\t    \"name\": \"Config_Change_Message\",\n                    \"type\": \"record\",\n                    \"fields\": [\n                        {\n                            \"name\": \"name\",\n                            \"type\": \"string\"\n                        },\n\t\t\t{\n                            \"name\": \"administrative_DasH_state\",\n                            \"type\": \"string\"\n                        }\n                    ]\n                }\n\t    }\n        }\n    ]\n}"}},{"key":{"name":"MessageSchema","version":"0.0.1"},"value":{"key":{"name":"MessageSchema","version":"0.0.1"},"schemaFlavour":"Java","schemaDefinition":"java.lang.String"}},{"key":{"name":"OduIdSchema","version":"0.0.1"},"value":{"key":{"name":"OduIdSchema","version":"0.0.1"},"schemaFlavour":"Java","schemaDefinition":"java.lang.String"}},{"key":{"name":"OruIdSchema","version":"0.0.1"},"value":{"key":{"name":"OruIdSchema","version":"0.0.1"},"schemaFlavour":"Java","schemaDefinition":"java.lang.String"}}]}}}}},"eventOutputParameters":{"RestProducer":{"carrierTechnologyParameters":{"carrierTechnology":"RESTCLIENT","parameterClassName":"org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters","parameters":{"url":"http://sdnr-sim:9990/rests/data/network-topology:network-topology/topology=topology-netconf/node={OduId}/yang-ext:mount/o-ran-sc-du-hello-world:network-function/du-to-ru-connection={OruId}"}},"eventProtocolParameters":{"eventProtocol":"JSON","parameters":{"pojoField":"LinkFailureOutput"}},"eventNameFilter":"LinkFailureOutputEvent"},"StdOutProducer":{"carrierTechnologyParameters":{"carrierTechnology":"FILE","parameters":{"standardIo":true}},"eventProtocolParameters":{"eventProtocol":"JSON","parameters":{"pojoField":"message"}},"eventNameFilter":"ApexMessageOutputEvent"}},"eventInputParameters":{"DMaaPConsumer":{"carrierTechnologyParameters":{"carrierTechnology":"RESTCLIENT","parameterClassName":"org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters","parameters":{"url":"http://dmaap-mr:3904/events/unauthenticated.SEC_FAULT_OUTPUT/users/link-monitor-nonrtric?timeout=15000&limit=100"}},"eventProtocolParameters":{"eventProtocol":"JSON","parameters":{"versionAlias":"version","pojoField":"LinkFailureInput"}},"eventName":"LinkFailureInputEvent"}}}}}]}}
\ No newline at end of file
index ae753ca..69deb0a 100644 (file)
 
 executor.logger.info("Task Execution: '"+executor.subject.id+"'. Input Fields: '"+executor.inFields+"'");
 
-var fileReaderClass = java.io.FileReader;
-var bufferedReaderClass = java.io.BufferedReader;
-var oruOduMap;
-try {
-    var br = new bufferedReaderClass(new fileReaderClass("/home/apexuser/examples/LinkMonitor/config/o-ru-to-o-du-map.json"));
-    var jsonString = "";
-    var line;
-    while ((line = br.readLine()) != null) {
-        jsonString += line;
-    }
-    oruOduMap = JSON.parse(jsonString);
-} catch (err) {
-    executor.logger.info("Failed to read o-ru-to-o-du-map.json file " + err);
-}
-
+var returnValue = true;
 var linkFailureInput = executor.inFields.get("LinkFailureInput");
 var oruId = linkFailureInput.get("event").get("commonEventHeader").get("sourceName");
-var oduId = oruOduMap[oruId];
+var oruOduMap = JSON.parse(executor.parameters.get("ORU-ODU-Map"));
 
-executor.outFields.put("OruId", oruId);
-executor.outFields.put("OduId", oduId);
-
-executor.logger.info(executor.outFields);
+if (oruId in oruOduMap) {
+    var oduId = oruOduMap[oruId];
+    executor.outFields.put("OruId", oruId);
+    executor.outFields.put("OduId", oduId);
+    executor.logger.info(executor.outFields);
+} else {
+    executor.message = "No O-RU found in the config with this ID: " + oruId;
+    returnValue = false;
+}
 
-true;
+returnValue;
diff --git a/test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/models/ToscaPolicy.json b/test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/models/ToscaPolicy.json
deleted file mode 100644 (file)
index 66a22be..0000000
+++ /dev/null
@@ -1 +0,0 @@
-{"tosca_definitions_version":"tosca_simple_yaml_1_1_0","topology_template":{"policies":[{"onap.policies.native.apex.Test":{"type":"onap.policies.native.Apex","type_version":"1.0.0","name":"onap.policies.native.apex.Test","version":"1.0.0","properties":{"engineServiceParameters":{"name":"LinkMonitorApexEngine","version":"0.0.1","id":101,"instanceCount":4,"deploymentPort":12345,"engineParameters":{"executorParameters":{"JAVASCRIPT":{"parameterClassName":"org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters"}},"contextParameters":{"parameterClassName":"org.onap.policy.apex.context.parameters.ContextParameters","schemaParameters":{"Avro":{"parameterClassName":"org.onap.policy.apex.plugins.context.schema.avro.AvroSchemaHelperParameters"}}}},"policy_type_impl":{"apexPolicyModel":{"key":{"name":"LinkMonitorModel","version":"0.0.1"},"keyInformation":{"key":{"name":"LinkMonitorModel_KeyInfo","version":"0.0.1"},"keyInfoMap":{"entry":[{"key":{"name":"ApexMessageOutputEvent","version":"0.0.1"},"value":{"key":{"name":"ApexMessageOutputEvent","version":"0.0.1"},"UUID":"cca47d74-7754-4a61-b163-ca31f66b157b","description":"Generated description for concept referred to by key \"ApexMessageOutputEvent:0.0.1\""}},{"key":{"name":"CreateLinkClearedOutfieldsEvent","version":"0.0.1"},"value":{"key":{"name":"CreateLinkClearedOutfieldsEvent","version":"0.0.1"},"UUID":"a295d6a3-1b73-387e-abba-b41e9b608802","description":"Generated description for concept referred to by key \"CreateLinkClearedOutfieldsEvent:0.0.1\""}},{"key":{"name":"CreateLinkClearedOutfieldsTask","version":"0.0.1"},"value":{"key":{"name":"CreateLinkClearedOutfieldsTask","version":"0.0.1"},"UUID":"fd594e88-411d-4a94-b2be-697b3a0d7adf","description":"This task creates the output fields when link failure is cleared."}},{"key":{"name":"CreateLinkFailureOutfieldsEvent","version":"0.0.1"},"value":{"key":{"name":"CreateLinkFailureOutfieldsEvent","version":"0.0.1"},"UUID":"02be2b5d-45b7-3c54-ae54-97f2b5c30125","description":"Generated description for concept referred to by key \"CreateLinkFailureOutfieldsEvent:0.0.1\""}},{"key":{"name":"CreateLinkFailureOutfieldsTask","version":"0.0.1"},"value":{"key":{"name":"CreateLinkFailureOutfieldsTask","version":"0.0.1"},"UUID":"ac3d9842-80af-4a98-951c-bd79a431c613","description":"This task the output fields when link failure is detected."}},{"key":{"name":"LinkClearedTask","version":"0.0.1"},"value":{"key":{"name":"LinkClearedTask","version":"0.0.1"},"UUID":"eecfde90-896c-4343-8f9c-2603ced94e2d","description":"This task sends a message to the output when link failure is cleared."}},{"key":{"name":"LinkFailureInputEvent","version":"0.0.1"},"value":{"key":{"name":"LinkFailureInputEvent","version":"0.0.1"},"UUID":"c4500941-3f98-4080-a9cc-5b9753ed050b","description":"Generated description for concept referred to by key \"LinkFailureInputEvent:0.0.1\""}},{"key":{"name":"LinkFailureInputSchema","version":"0.0.1"},"value":{"key":{"name":"LinkFailureInputSchema","version":"0.0.1"},"UUID":"3b3974fc-3012-3b02-9f33-c9d8eefe4dc1","description":"Generated description for concept referred to by key \"LinkFailureInputSchema:0.0.1\""}},{"key":{"name":"LinkFailureOutputEvent","version":"0.0.1"},"value":{"key":{"name":"LinkFailureOutputEvent","version":"0.0.1"},"UUID":"4f04aa98-e917-4f4a-882a-c75ba5a99374","description":"Generated description for concept referred to by key \"LinkFailureOutputEvent:0.0.1\""}},{"key":{"name":"LinkFailureOutputSchema","version":"0.0.1"},"value":{"key":{"name":"LinkFailureOutputSchema","version":"0.0.1"},"UUID":"2d1a7f6e-eb9a-3984-be1f-283d98111b84","description":"Generated description for concept referred to by key \"LinkFailureOutputSchema:0.0.1\""}},{"key":{"name":"LinkFailureTask","version":"0.0.1"},"value":{"key":{"name":"LinkFailureTask","version":"0.0.1"},"UUID":"3351b0f4-cf06-4fa2-8823-edf67bd30223","description":"This task updates the config for O-RU when link failure is detected."}},{"key":{"name":"LinkMonitorModel","version":"0.0.1"},"value":{"key":{"name":"LinkMonitorModel","version":"0.0.1"},"UUID":"540226fb-55ee-4f0e-a444-983a0494818e","description":"This is the Apex Policy Model for link monitoring."}},{"key":{"name":"LinkMonitorModel_Events","version":"0.0.1"},"value":{"key":{"name":"LinkMonitorModel_Events","version":"0.0.1"},"UUID":"27ad3e7e-fe3b-3bd6-9081-718705c2bcea","description":"Generated description for concept referred to by key \"LinkMonitorModel_Events:0.0.1\""}},{"key":{"name":"LinkMonitorModel_KeyInfo","version":"0.0.1"},"value":{"key":{"name":"LinkMonitorModel_KeyInfo","version":"0.0.1"},"UUID":"ea0b5f58-eefd-358a-9660-840c640bf981","description":"Generated description for concept referred to by key \"LinkMonitorModel_KeyInfo:0.0.1\""}},{"key":{"name":"LinkMonitorModel_Policies","version":"0.0.1"},"value":{"key":{"name":"LinkMonitorModel_Policies","version":"0.0.1"},"UUID":"ee9e0b0f-2b7d-3ab7-9a98-c5ec05ed823d","description":"Generated description for concept referred to by key \"LinkMonitorModel_Policies:0.0.1\""}},{"key":{"name":"LinkMonitorModel_Schemas","version":"0.0.1"},"value":{"key":{"name":"LinkMonitorModel_Schemas","version":"0.0.1"},"UUID":"fa5f9b8f-796c-3c70-84e9-5140c958c4bb","description":"Generated description for concept referred to by key \"LinkMonitorModel_Schemas:0.0.1\""}},{"key":{"name":"LinkMonitorModel_Tasks","version":"0.0.1"},"value":{"key":{"name":"LinkMonitorModel_Tasks","version":"0.0.1"},"UUID":"eec592f7-69d5-39a9-981a-e552f787ed01","description":"Generated description for concept referred to by key \"LinkMonitorModel_Tasks:0.0.1\""}},{"key":{"name":"LinkMonitorPolicy","version":"0.0.1"},"value":{"key":{"name":"LinkMonitorPolicy","version":"0.0.1"},"UUID":"6c5e410f-489a-46ff-964e-982ce6e8b6d0","description":"Generated description for concept referred to by key \"LinkMonitorPolicy:0.0.1\""}},{"key":{"name":"MessageSchema","version":"0.0.1"},"value":{"key":{"name":"MessageSchema","version":"0.0.1"},"UUID":"ac4b34ac-39d6-3393-a267-8d5b84854018","description":"A schema for messages from apex"}},{"key":{"name":"NoPolicyDefinedTask","version":"0.0.1"},"value":{"key":{"name":"NoPolicyDefinedTask","version":"0.0.1"},"UUID":"d48b619e-d00d-4008-b884-02d76ea4350b","description":"This task sends a message to the output when an event is received for which no policy has been defined."}},{"key":{"name":"OduIdSchema","version":"0.0.1"},"value":{"key":{"name":"OduIdSchema","version":"0.0.1"},"UUID":"50662174-a88b-3cbd-91bd-8e91b40b2660","description":"A schema for O-DU-ID"}},{"key":{"name":"OruIdSchema","version":"0.0.1"},"value":{"key":{"name":"OruIdSchema","version":"0.0.1"},"UUID":"54daf32b-015f-39cd-8530-a1175c5553e9","description":"A schema for O-RU-ID"}}]}},"policies":{"key":{"name":"LinkMonitorModel_Policies","version":"0.0.1"},"policyMap":{"entry":[{"key":{"name":"LinkMonitorPolicy","version":"0.0.1"},"value":{"policyKey":{"name":"LinkMonitorPolicy","version":"0.0.1"},"template":"Freestyle","state":{"entry":[{"key":"LinkClearedState","value":{"stateKey":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"NULL","localName":"LinkClearedState"},"trigger":{"name":"CreateLinkClearedOutfieldsEvent","version":"0.0.1"},"stateOutputs":{"entry":[{"key":"LinkClearedLogic_Output_Direct","value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkClearedState","localName":"LinkClearedLogic_Output_Direct"},"outgoingEvent":{"name":"ApexMessageOutputEvent","version":"0.0.1"},"nextState":{"parentKeyName":"NULL","parentKeyVersion":"0.0.0","parentLocalName":"NULL","localName":"NULL"}}}]},"contextAlbumReference":[],"taskSelectionLogic":{"key":"NULL","logicFlavour":"UNDEFINED","logic":""},"stateFinalizerLogicMap":{"entry":[]},"defaultTask":{"name":"LinkClearedTask","version":"0.0.1"},"taskReferences":{"entry":[{"key":{"name":"LinkClearedTask","version":"0.0.1"},"value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkClearedState","localName":"LinkClearedTask"},"outputType":"DIRECT","output":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkClearedState","localName":"LinkClearedLogic_Output_Direct"}}}]}}},{"key":"LinkFailureOrClearedState","value":{"stateKey":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"NULL","localName":"LinkFailureOrClearedState"},"trigger":{"name":"LinkFailureInputEvent","version":"0.0.1"},"stateOutputs":{"entry":[{"key":"CreateLinkClearedOutfieldsLogic_Output_Direct","value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"CreateLinkClearedOutfieldsLogic_Output_Direct"},"outgoingEvent":{"name":"CreateLinkClearedOutfieldsEvent","version":"0.0.1"},"nextState":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"NULL","localName":"LinkClearedState"}}},{"key":"CreateLinkFailureOutfieldsLogic_Output_Direct","value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"CreateLinkFailureOutfieldsLogic_Output_Direct"},"outgoingEvent":{"name":"CreateLinkFailureOutfieldsEvent","version":"0.0.1"},"nextState":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"NULL","localName":"LinkFailureState"}}},{"key":"NoPolicyDefinedLogic_Output_Direct","value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"NoPolicyDefinedLogic_Output_Direct"},"outgoingEvent":{"name":"ApexMessageOutputEvent","version":"0.0.1"},"nextState":{"parentKeyName":"NULL","parentKeyVersion":"0.0.0","parentLocalName":"NULL","localName":"NULL"}}}]},"contextAlbumReference":[],"taskSelectionLogic":{"key":"TaskSelectionLogic","logicFlavour":"JAVASCRIPT","logic":"/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2021 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(\"Task Selection Execution: '\"+executor.subject.id+\n    \"'. InputFields: '\"+executor.inFields+\"'\");\n\nvar linkFailureInput = executor.inFields.get(\"LinkFailureInput\");\n\nvar commonEventHeader = linkFailureInput.get(\"event\").get(\"commonEventHeader\");\nvar domain = commonEventHeader.get(\"domain\");\n\ntaskFailure = executor.subject.getTaskKey(\"CreateLinkFailureOutfieldsTask\");\ntaskCleared = executor.subject.getTaskKey(\"CreateLinkClearedOutfieldsTask\");\ntaskDefault = executor.subject.getDefaultTaskKey();\n\nif (domain == \"fault\") {\n    var faultFields = linkFailureInput.get(\"event\").get(\"faultFields\");\n    var alarmCondition = faultFields.get(\"alarmCondition\");\n    var eventSeverity = faultFields.get(\"eventSeverity\");\n    \n    if (alarmCondition == \"30\" && eventSeverity != \"NORMAL\") {\n        taskFailure.copyTo(executor.selectedTask);\n    } else if (alarmCondition == \"30\" && eventSeverity == \"NORMAL\") {\n        taskCleared.copyTo(executor.selectedTask);\n    } else {\n        taskDefault.copyTo(executor.selectedTask);\n    }\n} else {\n    taskDefault.copyTo(executor.selectedTask);\n}\n\ntrue;"},"stateFinalizerLogicMap":{"entry":[]},"defaultTask":{"name":"NoPolicyDefinedTask","version":"0.0.1"},"taskReferences":{"entry":[{"key":{"name":"CreateLinkClearedOutfieldsTask","version":"0.0.1"},"value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"CreateLinkClearedOutfieldsTask"},"outputType":"DIRECT","output":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"CreateLinkClearedOutfieldsLogic_Output_Direct"}}},{"key":{"name":"CreateLinkFailureOutfieldsTask","version":"0.0.1"},"value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"CreateLinkFailureOutfieldsTask"},"outputType":"DIRECT","output":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"CreateLinkFailureOutfieldsLogic_Output_Direct"}}},{"key":{"name":"NoPolicyDefinedTask","version":"0.0.1"},"value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"NoPolicyDefinedTask"},"outputType":"DIRECT","output":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureOrClearedState","localName":"NoPolicyDefinedLogic_Output_Direct"}}}]}}},{"key":"LinkFailureState","value":{"stateKey":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"NULL","localName":"LinkFailureState"},"trigger":{"name":"CreateLinkFailureOutfieldsEvent","version":"0.0.1"},"stateOutputs":{"entry":[{"key":"LinkFailureLogic_Output_Direct","value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureState","localName":"LinkFailureLogic_Output_Direct"},"outgoingEvent":{"name":"LinkFailureOutputEvent","version":"0.0.1"},"nextState":{"parentKeyName":"NULL","parentKeyVersion":"0.0.0","parentLocalName":"NULL","localName":"NULL"}}}]},"contextAlbumReference":[],"taskSelectionLogic":{"key":"NULL","logicFlavour":"UNDEFINED","logic":""},"stateFinalizerLogicMap":{"entry":[]},"defaultTask":{"name":"LinkFailureTask","version":"0.0.1"},"taskReferences":{"entry":[{"key":{"name":"LinkFailureTask","version":"0.0.1"},"value":{"key":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureState","localName":"LinkFailureTask"},"outputType":"DIRECT","output":{"parentKeyName":"LinkMonitorPolicy","parentKeyVersion":"0.0.1","parentLocalName":"LinkFailureState","localName":"LinkFailureLogic_Output_Direct"}}}]}}}]},"firstState":"LinkFailureOrClearedState"}}]}},"tasks":{"key":{"name":"LinkMonitorModel_Tasks","version":"0.0.1"},"taskMap":{"entry":[{"key":{"name":"CreateLinkClearedOutfieldsTask","version":"0.0.1"},"value":{"key":{"name":"CreateLinkClearedOutfieldsTask","version":"0.0.1"},"inputFields":{"entry":[{"key":"LinkFailureInput","value":{"key":"LinkFailureInput","fieldSchemaKey":{"name":"LinkFailureInputSchema","version":"0.0.1"},"optional":false}}]},"outputFields":{"entry":[{"key":"OruId","value":{"key":"OruId","fieldSchemaKey":{"name":"OruIdSchema","version":"0.0.1"},"optional":false}}]},"taskParameters":{"entry":[]},"contextAlbumReference":[],"taskLogic":{"key":"TaskLogic","logicFlavour":"JAVASCRIPT","logic":"/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2021 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\");\n\nvar linkFailureInput = executor.inFields.get(\"LinkFailureInput\");\n\nvar oruId = linkFailureInput.get(\"event\").get(\"commonEventHeader\").get(\"sourceName\");\n\nexecutor.outFields.put(\"OruId\", oruId);\n\nexecutor.logger.info(executor.outFields);\n\ntrue;"}}},{"key":{"name":"CreateLinkFailureOutfieldsTask","version":"0.0.1"},"value":{"key":{"name":"CreateLinkFailureOutfieldsTask","version":"0.0.1"},"inputFields":{"entry":[{"key":"LinkFailureInput","value":{"key":"LinkFailureInput","fieldSchemaKey":{"name":"LinkFailureInputSchema","version":"0.0.1"},"optional":false}}]},"outputFields":{"entry":[{"key":"OduId","value":{"key":"OduId","fieldSchemaKey":{"name":"OduIdSchema","version":"0.0.1"},"optional":false}},{"key":"OruId","value":{"key":"OruId","fieldSchemaKey":{"name":"OruIdSchema","version":"0.0.1"},"optional":false}}]},"taskParameters":{"entry":[]},"contextAlbumReference":[],"taskLogic":{"key":"TaskLogic","logicFlavour":"JAVASCRIPT","logic":"/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2021 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\");\n\n//const oruOduMap = require('/home/apexuser/examples/LinkMonitor/config/o-ru-to-o-du-map.json')\n\nvar fileReaderClass = java.io.FileReader;\nvar bufferedReaderClass = java.io.BufferedReader;\nvar oruOduMap;     \ntry {\n    var br = new bufferedReaderClass(new fileReaderClass(\"/home/apexuser/examples/LinkMonitor/config/o-ru-to-o-du-map.json\"));\n    var jsonString = \"\";\n    var line;\n    while ((line = br.readLine()) != null) {\n        jsonString += line;\n    }\n    oruOduMap = JSON.parse(jsonString);\n} catch (err) {\n    executor.logger.info(\"Failed to retrieve json file \" + err);\n}\n        \nvar linkFailureInput = executor.inFields.get(\"LinkFailureInput\");\n\nvar oruId = linkFailureInput.get(\"event\").get(\"commonEventHeader\").get(\"sourceName\");\n\nvar oduId = oruOduMap[oruId];\n\nexecutor.outFields.put(\"OruId\", oruId);\n\nexecutor.outFields.put(\"OduId\", oduId);\n\nexecutor.logger.info(executor.outFields);\n\ntrue;"}}},{"key":{"name":"LinkClearedTask","version":"0.0.1"},"value":{"key":{"name":"LinkClearedTask","version":"0.0.1"},"inputFields":{"entry":[{"key":"OruId","value":{"key":"OruId","fieldSchemaKey":{"name":"OruIdSchema","version":"0.0.1"},"optional":false}}]},"outputFields":{"entry":[{"key":"message","value":{"key":"message","fieldSchemaKey":{"name":"MessageSchema","version":"0.0.1"},"optional":false}}]},"taskParameters":{"entry":[]},"contextAlbumReference":[],"taskLogic":{"key":"TaskLogic","logicFlavour":"JAVASCRIPT","logic":"/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2021 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\");\n\nvar oruId = executor.inFields.get(\"OruId\");\n\nexecutor.outFields.put(\"message\", \"CLEARED link failure for O-RU: \" + oruId);\n\nexecutor.logger.info(executor.outFields);\n\ntrue;"}}},{"key":{"name":"LinkFailureTask","version":"0.0.1"},"value":{"key":{"name":"LinkFailureTask","version":"0.0.1"},"inputFields":{"entry":[{"key":"OduId","value":{"key":"OduId","fieldSchemaKey":{"name":"OduIdSchema","version":"0.0.1"},"optional":false}},{"key":"OruId","value":{"key":"OruId","fieldSchemaKey":{"name":"OruIdSchema","version":"0.0.1"},"optional":false}}]},"outputFields":{"entry":[{"key":"LinkFailureOutput","value":{"key":"LinkFailureOutput","fieldSchemaKey":{"name":"LinkFailureOutputSchema","version":"0.0.1"},"optional":false}}]},"taskParameters":{"entry":[]},"contextAlbumReference":[],"taskLogic":{"key":"TaskLogic","logicFlavour":"JAVASCRIPT","logic":"/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2021 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\");\n\nvar linkFailureOutput = executor.subject.getOutFieldSchemaHelper(\"LinkFailureOutput\").createNewInstance();\n\nvar oruId = executor.inFields.get(\"OruId\");\nvar oduId = executor.inFields.get(\"OduId\");\n\nvar unlockMessageArray = new java.util.ArrayList();\nfor (var i = 0; i < 1; i++) {   \n    unlockMessageArray.add({ \n        \"name\" : oruId,\n        \"administrative_DasH_state\" : \"UNLOCKED\"\n    });\n}\n\nlinkFailureOutput.put(\"o_DasH_ran_DasH_sc_DasH_du_DasH_hello_DasH_world_ColoN_du_DasH_to_DasH_ru_DasH_connection\", unlockMessageArray);\nexecutor.outFields.put(\"LinkFailureOutput\", linkFailureOutput.toString());\n\nexecutor.getExecutionProperties().setProperty(\"OduId\", oduId);\nexecutor.getExecutionProperties().setProperty(\"OruId\", oruId);\n\nexecutor.logger.info(executor.outFields);\n\ntrue;"}}},{"key":{"name":"NoPolicyDefinedTask","version":"0.0.1"},"value":{"key":{"name":"NoPolicyDefinedTask","version":"0.0.1"},"inputFields":{"entry":[{"key":"LinkFailureInput","value":{"key":"LinkFailureInput","fieldSchemaKey":{"name":"LinkFailureInputSchema","version":"0.0.1"},"optional":false}}]},"outputFields":{"entry":[{"key":"message","value":{"key":"message","fieldSchemaKey":{"name":"MessageSchema","version":"0.0.1"},"optional":false}}]},"taskParameters":{"entry":[]},"contextAlbumReference":[],"taskLogic":{"key":"TaskLogic","logicFlavour":"JAVASCRIPT","logic":"/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2021 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(\"Task Execution: '\"+executor.subject.id+\"'. Input Fields: '\"+executor.inFields+\"'\");\n\nexecutor.outFields.put(\"message\", \"No policy defined for this event\");\n\nexecutor.logger.info(executor.outFields);\n\ntrue;"}}}]}},"events":{"key":{"name":"LinkMonitorModel_Events","version":"0.0.1"},"eventMap":{"entry":[{"key":{"name":"ApexMessageOutputEvent","version":"0.0.1"},"value":{"key":{"name":"ApexMessageOutputEvent","version":"0.0.1"},"nameSpace":"org.onap.policy.apex.auth.clieditor","source":"APEX","target":"APEX","parameter":{"entry":[{"key":"message","value":{"key":"message","fieldSchemaKey":{"name":"MessageSchema","version":"0.0.1"},"optional":false}}]}}},{"key":{"name":"CreateLinkClearedOutfieldsEvent","version":"0.0.1"},"value":{"key":{"name":"CreateLinkClearedOutfieldsEvent","version":"0.0.1"},"nameSpace":"org.onap.policy.apex.auth.clieditor","source":"APEX","target":"APEX","parameter":{"entry":[{"key":"OruId","value":{"key":"OruId","fieldSchemaKey":{"name":"OruIdSchema","version":"0.0.1"},"optional":false}}]}}},{"key":{"name":"CreateLinkFailureOutfieldsEvent","version":"0.0.1"},"value":{"key":{"name":"CreateLinkFailureOutfieldsEvent","version":"0.0.1"},"nameSpace":"org.onap.policy.apex.auth.clieditor","source":"APEX","target":"APEX","parameter":{"entry":[{"key":"OduId","value":{"key":"OduId","fieldSchemaKey":{"name":"OduIdSchema","version":"0.0.1"},"optional":false}},{"key":"OruId","value":{"key":"OruId","fieldSchemaKey":{"name":"OruIdSchema","version":"0.0.1"},"optional":false}}]}}},{"key":{"name":"LinkFailureInputEvent","version":"0.0.1"},"value":{"key":{"name":"LinkFailureInputEvent","version":"0.0.1"},"nameSpace":"org.onap.policy.apex.auth.clieditor","source":"DMAAP","target":"APEX","parameter":{"entry":[{"key":"LinkFailureInput","value":{"key":"LinkFailureInput","fieldSchemaKey":{"name":"LinkFailureInputSchema","version":"0.0.1"},"optional":false}}]}}},{"key":{"name":"LinkFailureOutputEvent","version":"0.0.1"},"value":{"key":{"name":"LinkFailureOutputEvent","version":"0.0.1"},"nameSpace":"org.onap.policy.apex.auth.clieditor","source":"APEX","target":"OAM","parameter":{"entry":[{"key":"LinkFailureOutput","value":{"key":"LinkFailureOutput","fieldSchemaKey":{"name":"LinkFailureOutputSchema","version":"0.0.1"},"optional":false}}]}}}]}},"schemas":{"key":{"name":"LinkMonitorModel_Schemas","version":"0.0.1"},"schemas":{"entry":[{"key":{"name":"LinkFailureInputSchema","version":"0.0.1"},"value":{"key":{"name":"LinkFailureInputSchema","version":"0.0.1"},"schemaFlavour":"Avro","schemaDefinition":"{\n    \"type\": \"record\",\n    \"name\": \"Link_Failure_Input\",\n    \"fields\": [\n        {\n            \"name\": \"event\",\n            \"type\": {\n                \"type\": \"record\",\n                \"name\": \"Event_Type\",\n                \"fields\": [\n                    {\n                        \"name\": \"commonEventHeader\",\n                        \"type\": {\n                            \"type\": \"record\",\n                            \"name\": \"Common_Event_Header_Type\",\n                            \"fields\": [\n                                {\n                                    \"name\": \"domain\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"eventId\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"eventName\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"eventType\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"sequence\",\n                                    \"type\": \"int\"\n                                },\n                                {\n                                    \"name\": \"priority\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"reportingEntityId\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"reportingEntityName\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"sourceId\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"sourceName\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"startEpochMicrosec\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"lastEpochMicrosec\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"nfNamingCode\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"nfVendorName\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"timeZoneOffset\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"version\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"vesEventListenerVersion\",\n                                    \"type\": \"string\"\n                                }\n                            ]\n                        }\n                    },\n                    {\n                        \"name\": \"faultFields\",\n                        \"type\": {\n                            \"type\": \"record\",\n                            \"name\": \"Fault_Fields_Type\",\n                            \"fields\": [\n                                {\n                                    \"name\": \"faultFieldsVersion\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"alarmCondition\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"alarmInterfaceA\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"eventSourceType\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"specificProblem\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"eventSeverity\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"vfStatus\",\n                                    \"type\": \"string\"\n                                },\n                                {\n                                    \"name\": \"alarmAdditionalInformation\",\n                                    \"type\": {\n                                        \"type\": \"record\",\n                                        \"name\": \"Alarm_Additional_Information_Type\",\n                                        \"fields\": [\n                                            {\n                                                \"name\": \"eventTime\",\n                                                \"type\": \"string\"\n                                            },\n                                            {\n                                                \"name\": \"equipType\",\n                                                \"type\": \"string\"\n                                            },\n                                            {\n                                                \"name\": \"vendor\",\n                                                \"type\": \"string\"\n                                            },\n                                            {\n                                                \"name\": \"model\",\n                                                \"type\": \"string\"\n                                            }\n                                        ]\n                                    }\n                                }\n                            ]\n                        }\n                    }\n                ]\n            }\n        }\n    ]\n}"}},{"key":{"name":"LinkFailureOutputSchema","version":"0.0.1"},"value":{"key":{"name":"LinkFailureOutputSchema","version":"0.0.1"},"schemaFlavour":"Avro","schemaDefinition":"{\n    \"type\": \"record\",\n    \"name\": \"Link_Failure_Output\",\n    \"fields\": [\n        {\n            \"name\": \"o_DasH_ran_DasH_sc_DasH_du_DasH_hello_DasH_world_ColoN_du_DasH_to_DasH_ru_DasH_connection\",\n            \"type\": {\n        \t\"type\": \"array\",\n        \t\"items\": {\n\t\t    \"name\": \"Config_Change_Message\",\n                    \"type\": \"record\",\n                    \"fields\": [\n                        {\n                            \"name\": \"name\",\n                            \"type\": \"string\"\n                        },\n\t\t\t{\n                            \"name\": \"administrative_DasH_state\",\n                            \"type\": \"string\"\n                        }\n                    ]\n                }\n\t    }\n        }\n    ]\n}"}},{"key":{"name":"MessageSchema","version":"0.0.1"},"value":{"key":{"name":"MessageSchema","version":"0.0.1"},"schemaFlavour":"Java","schemaDefinition":"java.lang.String"}},{"key":{"name":"OduIdSchema","version":"0.0.1"},"value":{"key":{"name":"OduIdSchema","version":"0.0.1"},"schemaFlavour":"Java","schemaDefinition":"java.lang.String"}},{"key":{"name":"OruIdSchema","version":"0.0.1"},"value":{"key":{"name":"OruIdSchema","version":"0.0.1"},"schemaFlavour":"Java","schemaDefinition":"java.lang.String"}}]}}}}},"eventOutputParameters":{"RestProducer":{"carrierTechnologyParameters":{"carrierTechnology":"RESTCLIENT","parameterClassName":"org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters","parameters":{"url":"http://sdnr-sim:9990/rests/data/network-topology:network-topology/topology=topology-netconf/node={OduId}/yang-ext:mount/o-ran-sc-du-hello-world:network-function/du-to-ru-connection={OruId}"}},"eventProtocolParameters":{"eventProtocol":"JSON","parameters":{"pojoField":"LinkFailureOutput"}},"eventNameFilter":"LinkFailureOutputEvent"},"StdOutProducer":{"carrierTechnologyParameters":{"carrierTechnology":"FILE","parameters":{"standardIo":true}},"eventProtocolParameters":{"eventProtocol":"JSON"}}},"eventInputParameters":{"DMaaPConsumer":{"carrierTechnologyParameters":{"carrierTechnology":"RESTCLIENT","parameterClassName":"org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters","parameters":{"url":"http://dmaap-mr:3904/events/unauthenticated.SEC_FAULT_OUTPUT/users/link-monitor-nonrtric?timeout=15000&limit=100"}},"eventProtocolParameters":{"eventProtocol":"JSON","parameters":{"versionAlias":"version","pojoField":"LinkFailureInput"}},"eventName":"LinkFailureInputEvent"}}}}}]}}
\ No newline at end of file
index a22d9a9..8f425a5 100644 (file)
@@ -3,10 +3,10 @@
   "topology_template": {
     "policies": [
       {
-        "onap.policies.native.apex.Test": {
+        "onap.policies.native.apex.LinkMonitor": {
           "type": "onap.policies.native.Apex",
           "type_version": "1.0.0",
-          "name": "onap.policies.native.apex.Test",
+          "name": "onap.policies.native.apex.LinkMonitor",
           "version": "1.0.0",
           "properties": {
           }