Merge "Update docker-compose file and data scripts in nonrtric repo"
authorHenrik Andersson <henrik.b.andersson@est.tech>
Thu, 10 Jun 2021 05:35:18 +0000 (05:35 +0000)
committerGerrit Code Review <gerrit@o-ran-sc.org>
Thu, 10 Jun 2021 05:35:18 +0000 (05:35 +0000)
35 files changed:
docker-compose/docker-compose-policy-framework/config/apex-pdp/OnapPfConfig.json
docker-compose/docker-compose-policy-framework/config/dns_keystore.txt
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/APPC-CL-topic.properties
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/APPC-LCM-READ-topic.properties
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/APPC-LCM-WRITE-topic.properties
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/DCAE_CL_RSP-topic.properties
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/DCAE_TOPIC-topic.properties
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/GUARD-http-client.properties
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/POLICY-CL-MGT-topic.properties
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/SDNC-http-client.properties
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/SDNR-CL-RSP-topic.properties
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/SDNR-CL-topic.properties
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/VFC-http-client.properties
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/engine.properties
docker-compose/docker-compose-policy-framework/config/drools-apps/custom/feature-lifecycle.properties
docker-compose/docker-compose-policy-framework/config/drools-apps/env/base.conf
docker-compose/docker-compose-policy-framework/config/drools/custom/engine.properties
docker-compose/docker-compose-policy-framework/config/drools/env/base.conf
docker-compose/docker-compose-policy-framework/config/pap/defaultConfig.json
docker-compose/docker-compose-policy-framework/config/xacml-pdp/defaultConfig.json
docker-compose/docker-compose-policy-framework/docker-compose.yml
docker-compose/nonrtric-gateway/docker-compose.yaml
enrichment-coordinator-service/pom.xml
test/common/test_env-oran-d-release.sh
test/http-https-proxy/Dockerfile
test/simulator-group/control_panel/mnt/.gitignore [new file with mode: 0644]
test/simulator-group/ngw/mnt/.gitignore [new file with mode: 0644]
test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/config/LinkMonitorConfigDmaap2RestJsonEvent.json
test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/deployment/ToscaPolicy.json
test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/events/LinkClearedEvent.json
test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/events/LinkFailureEvent.json
test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/models/TaskSelectionLogic.js
test/usecases/oruclosedlooprecovery/scriptversion/app/main.py
test/usecases/oruclosedlooprecovery/scriptversion/simulators/message_generator.py
test/usecases/oruclosedlooprecovery/scriptversion/simulators/sdnr_simulator.py

index e1f6b23..f48630f 100644 (file)
     "topicParameterGroup": {
         "topicSources" : [{
             "topic" : "POLICY-PDP-PAP",
-            "servers" : [ "dmaap-mr" ],
+            "servers" : [ "onap-dmaap" ],
             "topicCommInfrastructure" : "dmaap",
             "useHttps" : false,
             "allowSelfSignedCerts" : true
         }],
         "topicSinks" : [{
             "topic" : "POLICY-PDP-PAP",
-            "servers" : [ "dmaap-mr" ],
+            "servers" : [ "onap-dmaap" ],
             "topicCommInfrastructure" : "dmaap",
             "useHttps" : false,
             "allowSelfSignedCerts" : true
index f265b7c..77362f2 100644 (file)
@@ -20,9 +20,9 @@ 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.https=false
 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.https=false
 dmaap.sink.topics.APPC-CL.selfSignedCertificates=true
index f4a48dc..f444f38 100644 (file)
@@ -19,5 +19,5 @@
 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.https=false
 dmaap.sink.topics.APPC-LCM-READ.selfSignedCertificates=true
index 51cb018..2398550 100644 (file)
@@ -19,5 +19,5 @@
 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.https=false
 dmaap.source.topics.APPC-LCM-WRITE.selfSignedCertificates=true
index b02f90c..b31cddb 100644 (file)
@@ -19,5 +19,5 @@
 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.https=false
 dmaap.sink.topics.DCAE_CL_RSP.selfSignedCertificates=true
index 608ba8d..38f9f89 100644 (file)
@@ -21,5 +21,5 @@ 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.https=false
 dmaap.source.topics.DCAE_TOPIC.selfSignedCertificates=true
index e4c2553..4266b04 100644 (file)
@@ -19,7 +19,7 @@
 http.client.services=GUARD
 
 http.client.services.GUARD.managed=true
-http.client.services.GUARD.https=true
+http.client.services.GUARD.https=false
 http.client.services.GUARD.host=${envd:PDP_HOST}
 http.client.services.GUARD.port=${envd:PDP_PORT}
 http.client.services.GUARD.userName=${envd:PDP_USERNAME}
index f2b6826..7fa0f10 100644 (file)
@@ -18,5 +18,5 @@
 
 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.https=false
 dmaap.sink.topics.POLICY-CL-MGT.selfSignedCertificates=true
index 9115950..3f91b07 100644 (file)
@@ -19,7 +19,7 @@
 http.client.services=SDNC
 
 http.client.services.SDNC.managed=true
-http.client.services.SDNC.https=true
+http.client.services.SDNC.https=false
 http.client.services.SDNC.host=${envd:SDNC_HOST}
 http.client.services.SDNC.port=${envd:SDNC_PORT}
 http.client.services.SDNC.userName=${envd:SDNC_USERNAME}
index 27a762c..79b5e55 100644 (file)
@@ -18,5 +18,5 @@
 
 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.https=false
 dmaap.source.topics.SDNR-CL-RSP.selfSignedCertificates=true
index 8f2a26c..5eac5e3 100644 (file)
@@ -19,5 +19,5 @@
 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.https=false
 dmaap.sink.topics.SDNR-CL.selfSignedCertificates=true
index 454e8a9..c267b7a 100644 (file)
@@ -19,7 +19,7 @@
 http.client.services=VFC
 
 http.client.services.VFC.managed=true
-http.client.services.VFC.https=true
+http.client.services.VFC.https=false
 http.client.services.VFC.host=${envd:VFC_HOST}
 http.client.services.VFC.port=${envd:VFC_PORT}
 http.client.services.VFC.userName=${envd:VFC_USERNAME}
index cf2ed85..01e6ed6 100644 (file)
@@ -29,7 +29,7 @@ dmaap.source.topics.PDPD-CONFIGURATION.apiSecret=${envd:PDPD_CONFIGURATION_API_S
 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.https=false
 dmaap.source.topics.PDPD-CONFIGURATION.selfSignedCertificates=true
 
 http.server.services=SECURED-CONFIG
@@ -41,7 +41,7 @@ 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.https=false
 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
 
index 2ce112e..ab97035 100644 (file)
@@ -29,12 +29,12 @@ 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.https=false
 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.https=false
 dmaap.sink.topics.POLICY-PDP-PAP.selfSignedCertificates=true
index dfc6a7d..790bf55 100644 (file)
@@ -29,7 +29,7 @@ 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.https=false
 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
 
index 8bce2d5..369a37c 100644 (file)
     "topicParameterGroup": {
         "topicSources" : [{
             "topic" : "POLICY-PDP-PAP",
-            "servers" : [ "dmaap-mr" ],
+            "servers" : [ "onap-dmaap" ],
             "topicCommInfrastructure" : "dmaap",
             "useHttps": false,
             "allowSelfSignedCerts" : true
         }],
         "topicSinks" : [{
             "topic" : "POLICY-PDP-PAP",
-            "servers" : [ "dmaap-mr" ],
+            "servers" : [ "onap-dmaap" ],
             "topicCommInfrastructure" : "dmaap",
             "useHttps": false,
             "allowSelfSignedCerts" : true
         },
         {
             "topic" : "POLICY-NOTIFICATION",
-            "servers" : [ "dmaap-mr" ],
+            "servers" : [ "onap-dmaap" ],
             "topicCommInfrastructure" : "dmaap",
             "useHttps": false,
             "allowSelfSignedCerts" : true
index 7dc401f..9f39089 100644 (file)
     "topicParameterGroup": {
         "topicSources" : [{
             "topic" : "POLICY-PDP-PAP",
-            "servers" : [ "dmaap-mr" ],
+            "servers" : [ "onap-dmaap" ],
             "topicCommInfrastructure" : "dmaap",
             "useHttps" : false,
             "allowSelfSignedCerts" : true
         }],
         "topicSinks" : [{
             "topic" : "POLICY-PDP-PAP",
-            "servers" : [ "dmaap-mr" ],
+            "servers" : [ "onap-dmaap" ],
             "topicCommInfrastructure" : "dmaap",
             "useHttps" : false,
             "allowSelfSignedCerts" : true
index 4cdde39..9a4557b 100644 (file)
@@ -70,7 +70,7 @@ services:
       command: [
         '-c', './policy-pap.sh',
         'mariadb', '3306',
-        'dmaap-mr', '3904',
+        'onap-dmaap', '3904',
         'api', '6969'
         ]
    xacml-pdp:
@@ -90,7 +90,7 @@ services:
       command: [
         '-c', './policy-pdpx.sh',
         'mariadb', '3306',
-        'dmaap-mr', '3904',
+        'onap-dmaap', '3904',
         'pap', '6969'
         ]
    drools:
@@ -112,7 +112,7 @@ services:
       command: [
         '-c', '/opt/app/policy/bin/pdpd-entrypoint.sh boot',
         'mariadb', '3306',
-        'dmaap-mr', '3904'
+        'onap-dmaap', '3904'
         ]
    drools-apps:
       image: nexus3.onap.org:10001/onap/policy-pdpd-cl:1.8.2
@@ -137,12 +137,8 @@ services:
       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'
+        'onap-dmaap', '3904',
+        'pap', '6969'
         ]
    apex-pdp:
       image: onap/policy-apex-pdp:latest
@@ -162,7 +158,7 @@ services:
       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',
+        'onap-dmaap', '3904',
         'pap', '6969'
         ]
    distribution:
@@ -183,7 +179,7 @@ services:
       command: [
         '-c', './policy-dist.sh',
         'mariadb', '3306',
-        'dmaap-mr', '3904',
+        'onap-dmaap', '3904',
         'pap', '6969',
         'apex-pdp', '6969'
         ]
index 6a7707f..f2bcdce 100644 (file)
@@ -22,7 +22,7 @@ networks:
 
 services:
   nonrtric-gateway:
-    image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-gateway:0.0.1
+    image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-gateway:1.0.0
     container_name: nonrtric-gateway
     networks:
       default:
index e7f2bd6..8d97767 100644 (file)
@@ -68,7 +68,7 @@
         <dependency>
             <groupId>org.springdoc</groupId>
             <artifactId>springdoc-openapi-ui</artifactId>
-            <version>1.5.2</version>
+            <version>1.5.4</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
index c244936..0f722b3 100755 (executable)
@@ -83,9 +83,9 @@ CONTROL_PANEL_IMAGE_TAG_REMOTE_RELEASE="2.2.0"
 
 # Gateway image and tags
 NRT_GATEWAY_IMAGE_BASE="o-ran-sc/nonrtric-gateway"
-NRT_GATEWAY_IMAGE_TAG_LOCAL="0.0.1-SNAPSHOT"
-NRT_GATEWAY_IMAGE_TAG_REMOTE_SNAPSHOT="0.0.1-SNAPSHOT"
-NRT_GATEWAY_IMAGE_TAG_REMOTE="0.0.1"
+NRT_GATEWAY_IMAGE_TAG_LOCAL="1.0.0-SNAPSHOT"
+NRT_GATEWAY_IMAGE_TAG_REMOTE_SNAPSHOT="1.0.0-SNAPSHOT"
+NRT_GATEWAY_IMAGE_TAG_REMOTE="1.0.0"
 NRT_GATEWAY_IMAGE_TAG_REMOTE_RELEASE="1.0.0"
 
 
index e961500..1ae78f4 100644 (file)
@@ -5,7 +5,7 @@ FROM ${NEXUS_PROXY_REPO}node:16-alpine3.12
 ENV NODE_ENV=production
 
 WORKDIR /usr/src/app/cert
-COPY cert/*.crt .
+COPY cert/*.crt ./   #Need trailing slash on dest for multiple file copy
 COPY cert/pass .
 
 WORKDIR /usr/src/app
diff --git a/test/simulator-group/control_panel/mnt/.gitignore b/test/simulator-group/control_panel/mnt/.gitignore
new file mode 100644 (file)
index 0000000..72e8ffc
--- /dev/null
@@ -0,0 +1 @@
+*
diff --git a/test/simulator-group/ngw/mnt/.gitignore b/test/simulator-group/ngw/mnt/.gitignore
new file mode 100644 (file)
index 0000000..72e8ffc
--- /dev/null
@@ -0,0 +1 @@
+*
index 2cc26f8..78966a9 100644 (file)
@@ -75,7 +75,7 @@
                 "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"
+                    "url": "http://onap-dmaap:3904/events/unauthenticated.SEC_FAULT_OUTPUT/users/link-monitor-nonrtric?timeout=15000&limit=100"
                 }
             },
             "eventProtocolParameters": {
index b80035a..e39312b 100644 (file)
@@ -1 +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
+{"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 == \"28\" && eventSeverity != \"NORMAL\") {\n        taskFailure.copyTo(executor.selectedTask);\n    } else if (alarmCondition == \"28\" && 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://onap-dmaap: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 782b62e..ffea3b6 100644 (file)
@@ -21,7 +21,7 @@
         },
         "faultFields": {
             "faultFieldsVersion": "4.0",
-            "alarmCondition": "30",
+            "alarmCondition": "28",
             "alarmInterfaceA": "o-ran-fm:alarm-notif/fault-source",
             "eventSourceType": "ietf-hardware (RFC8348) /hardware/component[not(parent)][1]/mfg-model or \"O-RU\"",
             "specificProblem": "",
index f005ead..98f81b1 100644 (file)
@@ -21,7 +21,7 @@
         },
         "faultFields": {
             "faultFieldsVersion": "4.0",
-            "alarmCondition": "30",
+            "alarmCondition": "28",
             "alarmInterfaceA": "o-ran-fm:alarm-notif/fault-source",
             "eventSourceType": "ietf-hardware (RFC8348) /hardware/component[not(parent)][1]/mfg-model or \"O-RU\"",
             "specificProblem": "",
index 4d0f359..2c3708e 100644 (file)
@@ -33,9 +33,9 @@ if (domain == "fault") {
     var faultFields = linkFailureInput.get("event").get("faultFields");
     var alarmCondition = faultFields.get("alarmCondition");
     var eventSeverity = faultFields.get("eventSeverity");
-    if (alarmCondition == "30" && eventSeverity != "NORMAL") {
+    if (alarmCondition == "28" && eventSeverity != "NORMAL") {
         taskFailure.copyTo(executor.selectedTask);
-    } else if (alarmCondition == "30" && eventSeverity == "NORMAL") {
+    } else if (alarmCondition == "28" && eventSeverity == "NORMAL") {
         taskCleared.copyTo(executor.selectedTask);
     } else {
         taskDefault.copyTo(executor.selectedTask);
index 30541d4..efd45e7 100644 (file)
@@ -25,6 +25,7 @@ import time
 
 MR_PATH = "/events/[TOPIC]/users/test/"
 SDNR_PATH = "/rests/data/network-topology:network-topology/topology=topology-netconf/node=[O-DU-ID]/yang-ext:mount/o-ran-sc-du-hello-world:network-function/du-to-ru-connection=[O-RU-ID]"
+FAUILT_ID = "28"
 
 UNLOCK_MESSAGE = {
     "o-ran-sc-du-hello-world:du-to-ru-connection": [
@@ -43,7 +44,7 @@ def is_message_new_link_failure(message):
     link_failure = False
     if (event_headers["domain"] == "fault"):
         fault_fields = msg_as_json["event"]["faultFields"]
-        link_failure = fault_fields["alarmCondition"] == "30" and fault_fields["eventSeverity"] != "NORMAL"
+        link_failure = fault_fields["alarmCondition"] == FAUILT_ID and fault_fields["eventSeverity"] != "NORMAL"
 
     return link_failure
 
@@ -55,7 +56,7 @@ def is_message_clear_link_failure(message):
     link_failure_clear = False
     if (event_headers["domain"] == "fault"):
         fault_fields = msg_as_json["event"]["faultFields"]
-        link_failure_clear = fault_fields["alarmCondition"] == "30" and fault_fields["eventSeverity"] == "NORMAL"
+        link_failure_clear = fault_fields["alarmCondition"] == FAUILT_ID and fault_fields["eventSeverity"] == "NORMAL"
 
     return link_failure_clear
 
@@ -89,6 +90,23 @@ def read_o_ru_to_o_du_map_from_file(map_file):
     return dictionary
 
 
+def poll_and_handle_messages(mr_address, sdnr_address):
+    while True:
+        try:
+            verboseprint("Polling")
+            response = requests.get(mr_address)
+            messages = response.json()
+            for message in messages:
+                if (is_message_new_link_failure(message)):
+                    handle_link_failure(message, o_ru_to_o_du_map, sdnr_address)
+                elif (is_message_clear_link_failure(message)):
+                    handle_clear_link_failure(message)
+        except Exception as inst:
+            print(inst)
+
+        time.sleep(pollTime)
+
+
 if __name__ == '__main__':
     parser = argparse.ArgumentParser(prog='PROG')
     parser.add_argument('--mrHost', help='The URL of the MR host (default: %(default)s)', default="http://message-router.onap")
@@ -135,17 +153,4 @@ if __name__ == '__main__':
     mr_address = mr_host + ":" + str(mr_port) + MR_PATH.replace("[TOPIC]", mr_topic)
     sdnr_address = sdnr_host + ":" + str(sdnr_port)
 
-    while True:
-        try:
-            verboseprint("Polling")
-            response = requests.get(mr_address)
-            messages = response.json()
-            for message in messages:
-                if (is_message_new_link_failure(message)):
-                    handle_link_failure(message, o_ru_to_o_du_map, sdnr_address)
-                elif (is_message_clear_link_failure(message)):
-                    handle_clear_link_failure(message)
-        except Exception as inst:
-            print(inst)
-
-        time.sleep(pollTime)
+    poll_and_handle_messages(mr_address, sdnr_address)
index 9c2ee08..8550133 100644 (file)
@@ -29,6 +29,7 @@ import time
 mr_host = "http://localhost"
 mr_port = "3904"
 MR_PATH = "/events/unauthenticated.SEC_FAULT_OUTPUT"
+FAULT_ID = "28"
 
 linkFailureMessage = {
     "event": {
@@ -53,7 +54,7 @@ linkFailureMessage = {
         },
         "faultFields": {
             "faultFieldsVersion": "4.0",
-            "alarmCondition": "30",
+            "alarmCondition": FAULT_ID,
             "alarmInterfaceA": "o-ran-fm:alarm-notif/fault-source",
             "eventSourceType": "ietf-hardware (RFC8348) /hardware/component[not(parent)][1]/mfg-model or \"O-RU\"",
             "specificProblem": "",
@@ -90,7 +91,8 @@ heartBeatMessage = {
    }
  }
 
-def sendPostRequest(url ,msg):
+
+def sendPostRequest(url, msg):
     try:
         requests.post(url, json=msg)
     except Exception as e:
@@ -98,6 +100,7 @@ def sendPostRequest(url ,msg):
         print(e.args)
         print(e)
 
+
 if __name__ == "__main__":
     if os.getenv("MR-HOST") is not None:
         mr_host = os.getenv("MR-HOST")
index fa40f2c..888fad6 100644 (file)
@@ -39,6 +39,8 @@ HOST_IP = "::"
 HOST_PORT = 9990
 APP_URL = "/rests/data/network-topology:network-topology/topology=topology-netconf/node=<string:o_du_id>/yang-ext:mount/o-ran-sc-du-hello-world:network-function/du-to-ru-connection=<string:o_ru_id>"
 
+FAULT_ID = "28"
+
 linkFailureMessage = {
     "event": {
         "commonEventHeader": {
@@ -62,7 +64,7 @@ linkFailureMessage = {
         },
         "faultFields": {
             "faultFieldsVersion": "4.0",
-            "alarmCondition": "30",
+            "alarmCondition": FAULT_ID,
             "alarmInterfaceA": "o-ran-fm:alarm-notif/fault-source",
             "eventSourceType": "ietf-hardware (RFC8348) /hardware/component[not(parent)][1]/mfg-model or \"O-RU\"",
             "specificProblem": "",