From 252a4bba14ebfa2bc58261a87d7c593414a5f944 Mon Sep 17 00:00:00 2001
From: FrancescoFioraEst <francesco.fiora@est.tech>
Date: Fri, 23 Jul 2021 15:53:46 +0100
Subject: Replace JSON properties files to Yaml from docker images

POLICY-3469: Replace JSON properties files to Yaml from docker images
Change-Id: I23fbd9d84640286725440453d464c397e3144662
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
---
 .../src/main/package/tarball/assembly.xml          | 13 +---
 .../main/resources/etc/ClRuntimeParameters.json    | 53 ---------------
 .../main/resources/etc/ClRuntimeParameters.yaml    | 54 +++++++++++++++
 .../resources/etc/DcaeParticipantParameters.json   | 70 --------------------
 .../resources/etc/DcaeParticipantParameters.yaml   | 55 ++++++++++++++++
 .../etc/KubernetesParticipantParameters.yaml       | 54 +++++++++++++++
 .../resources/etc/PolicyParticipantParameters.json | 76 ----------------------
 .../resources/etc/PolicyParticipantParameters.yaml | 33 ++++++++++
 8 files changed, 197 insertions(+), 211 deletions(-)
 delete mode 100644 packages/policy-clamp-tarball/src/main/resources/etc/ClRuntimeParameters.json
 create mode 100644 packages/policy-clamp-tarball/src/main/resources/etc/ClRuntimeParameters.yaml
 delete mode 100644 packages/policy-clamp-tarball/src/main/resources/etc/DcaeParticipantParameters.json
 create mode 100644 packages/policy-clamp-tarball/src/main/resources/etc/DcaeParticipantParameters.yaml
 create mode 100644 packages/policy-clamp-tarball/src/main/resources/etc/KubernetesParticipantParameters.yaml
 delete mode 100644 packages/policy-clamp-tarball/src/main/resources/etc/PolicyParticipantParameters.json
 create mode 100644 packages/policy-clamp-tarball/src/main/resources/etc/PolicyParticipantParameters.yaml

(limited to 'packages/policy-clamp-tarball/src/main')

diff --git a/packages/policy-clamp-tarball/src/main/package/tarball/assembly.xml b/packages/policy-clamp-tarball/src/main/package/tarball/assembly.xml
index 6e8cd454a..598c0cb3d 100644
--- a/packages/policy-clamp-tarball/src/main/package/tarball/assembly.xml
+++ b/packages/policy-clamp-tarball/src/main/package/tarball/assembly.xml
@@ -24,24 +24,13 @@
         <format>tar.gz</format>
     </formats>
     <includeBaseDirectory>false</includeBaseDirectory>
-    <dependencySets>
-        <dependencySet>
-            <useProjectArtifact>true</useProjectArtifact>
-            <outputDirectory>${file.separator}lib</outputDirectory>
-            <unpack>false</unpack>
-            <scope>runtime</scope>
-            <includes>
-                <include>*:jar</include>
-            </includes>
-        </dependencySet>
-    </dependencySets>
     <fileSets>
         <fileSet>
             <directory>${project.basedir}/src/main/resources/etc
             </directory>
             <includes>
-                <include>*.json</include>
                 <include>*.xml</include>
+                <include>*.yaml</include>
             </includes>
             <outputDirectory>${file.separator}etc</outputDirectory>
             <lineEnding>unix</lineEnding>
diff --git a/packages/policy-clamp-tarball/src/main/resources/etc/ClRuntimeParameters.json b/packages/policy-clamp-tarball/src/main/resources/etc/ClRuntimeParameters.json
deleted file mode 100644
index a6a3ff0f8..000000000
--- a/packages/policy-clamp-tarball/src/main/resources/etc/ClRuntimeParameters.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
-    "name": "ControlLoopRuntimeGroup",
-    "restServerParameters": {
-        "host": "0.0.0.0",
-        "port": 6969,
-        "userName": "healthcheck",
-        "password": "zb!XztG34",
-        "https": false,
-        "aaf": false
-    },
-    "participantParameters": {
-        "heartBeatMs": 120000,
-        "updateParameters": {
-            "maxRetryCount": 1,
-            "maxWaitMs": 30000
-        },
-        "stateChangeParameters": {
-            "maxRetryCount": 1,
-            "maxWaitMs": 30000
-        }
-    },
-    "databaseProviderParameters": {
-        "name": "PolicyProviderParameterGroup",
-        "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
-        "databaseDriver": "org.mariadb.jdbc.Driver",
-        "databaseUrl": "jdbc:mariadb://mariadb:3306/controlloop",
-        "databaseUser": "policy",
-        "databasePassword": "P01icY",
-        "persistenceUnit": "CommissioningMariaDb"
-    },
-    "topicParameterGroup": {
-        "topicSources": [
-            {
-                "topic": "POLICY-CLRUNTIME-PARTICIPANT",
-                "servers": [ "message-router" ],
-                "topicCommInfrastructure": "dmaap",
-                "fetchTimeout": 15000
-            }
-        ],
-        "topicSinks": [
-            {
-                "topic": "POLICY-CLRUNTIME-PARTICIPANT",
-                "servers": [ "message-router" ],
-                "topicCommInfrastructure": "dmaap"
-            },
-            {
-                "topic": "POLICY-NOTIFICATION",
-                "servers": [ "message-router" ],
-                "topicCommInfrastructure": "dmaap"
-            }
-        ]
-    }
-}
diff --git a/packages/policy-clamp-tarball/src/main/resources/etc/ClRuntimeParameters.yaml b/packages/policy-clamp-tarball/src/main/resources/etc/ClRuntimeParameters.yaml
new file mode 100644
index 000000000..3970d15f1
--- /dev/null
+++ b/packages/policy-clamp-tarball/src/main/resources/etc/ClRuntimeParameters.yaml
@@ -0,0 +1,54 @@
+spring:
+  security:
+    user:
+      name: healthcheck
+      password: zb!XztG34
+  http:
+    converters:
+      preferred-json-mapper: gson
+
+security:
+  enable-csrf: false
+
+server:
+  port: 6969
+  servlet:
+    context-path: /onap/controlloop
+  error:
+    path: /error
+
+
+runtime:
+  supervisionScannerIntervalSec: 1000
+  participantClUpdateIntervalSec: 1000
+  participantClStateChangeIntervalSec: 1000
+  participantParameters:
+    heartBeatMs: 120000
+    updateParameters:
+      maxRetryCount: 1
+      maxWaitMs: 30000
+    stateChangeParameters:
+      maxRetryCount: 1
+      maxWaitMs: 30000
+  databaseProviderParameters:
+    name: PolicyProviderParameterGroup
+    implementation: org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl
+    databaseDriver: org.mariadb.jdbc.Driver
+    databaseUrl: jdbc:mariadb://${mariadb.host:mariadb}:${mariadb.port:3306}/controlloop
+    databaseUser: policy
+    databasePassword: P01icY
+    persistenceUnit: CommissioningMariaDb
+  topicParameterGroup:
+    topicSources:
+      -
+        topic: POLICY-CLRUNTIME-PARTICIPANT
+        servers:
+          - ${topicServer:message-router}
+        topicCommInfrastructure: dmaap
+        fetchTimeout: 15000
+    topicSinks:
+      -
+        topic: POLICY-CLRUNTIME-PARTICIPANT
+        servers:
+          - ${topicServer:message-router}
+        topicCommInfrastructure: dmaap
diff --git a/packages/policy-clamp-tarball/src/main/resources/etc/DcaeParticipantParameters.json b/packages/policy-clamp-tarball/src/main/resources/etc/DcaeParticipantParameters.json
deleted file mode 100644
index f3ff62325..000000000
--- a/packages/policy-clamp-tarball/src/main/resources/etc/DcaeParticipantParameters.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
-    "name": "ControlLoopParticipantDcae",
-    "clampClientParameters": {
-        "clientName": "Clamp",
-        "hostname": "0.0.0.0",
-        "port": 8443,
-        "userName": "admin",
-        "password": "password",
-        "useHttps": true,
-        "allowSelfSignedCerts": false
-    },
-    "consulClientParameters": {
-        "clientName": "Consul",
-        "hostname": "consul",
-        "port": 31321,
-        "userName": "admin",
-        "password": "password",
-        "useHttps": false
-    },
-    "intermediaryParameters": {
-        "name": "Participant parameters",
-        "reportingTimeInterval": 120000,
-        "description": "Participant Description",
-        "participantId": {
-            "name": "DCAEParticipant0",
-            "version": "1.0.0"
-        },
-        "participantType": {
-            "name": "org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipant",
-            "version": "2.3.4"
-        },
-        "clampControlLoopTopics": {
-            "topicSources": [
-                {
-                    "topic": "POLICY-CLRUNTIME-PARTICIPANT",
-                    "servers": [
-                        "message-router"
-                    ],
-                    "topicCommInfrastructure": "dmaap",
-                    "fetchTimeout": 15000
-                }
-            ],
-            "topicSinks": [
-                {
-                    "topic": "POLICY-CLRUNTIME-PARTICIPANT",
-                    "servers": [
-                        "message-router"
-                    ],
-                    "topicCommInfrastructure": "dmaap"
-                },
-                {
-                    "topic": "POLICY-NOTIFICATION",
-                    "servers": [
-                        "message-router"
-                    ],
-                    "topicCommInfrastructure": "dmaap"
-                }
-            ]
-        }
-    },
-    "databaseProviderParameters": {
-        "name": "PolicyProviderParameterGroup",
-        "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
-        "databaseDriver": "org.mariadb.jdbc.Driver",
-        "databaseUrl": "jdbc:mariadb://mariadb:3306/policyadmin",
-        "databaseUser": "policy_user",
-        "databasePassword": "policy_user",
-        "persistenceUnit": "PolicyMariaDb"
-    }
-}
diff --git a/packages/policy-clamp-tarball/src/main/resources/etc/DcaeParticipantParameters.yaml b/packages/policy-clamp-tarball/src/main/resources/etc/DcaeParticipantParameters.yaml
new file mode 100644
index 000000000..5eedb9db4
--- /dev/null
+++ b/packages/policy-clamp-tarball/src/main/resources/etc/DcaeParticipantParameters.yaml
@@ -0,0 +1,55 @@
+
+participant:
+  name: ControlLoopParticipantDcae
+  clampClientEndPoints:
+    status: /restservices/clds/v2/loop/getstatus/
+    create: /restservices/clds/v2/loop/create/%s?templateName=%s
+    deploy: /restservices/clds/v2/loop/deploy/
+    stop: /restservices/clds/v2/loop/stop/
+    delete: /restservices/clds/v2/loop/delete/
+    undeploy: /restservices/clds/v2/loop/undeploy/
+  clampClientParameters:
+    clientName: Clamp
+    hostname: 0.0.0.0
+    port: 8443
+    userName: admin
+    password: password
+    https: true
+    aaf: false
+  consulClientEndPoints:
+    deploy: "/v1/kv/dcae-pmsh:"
+  consulClientParameters:
+    clientName: Consul
+    hostname: consul
+    port: 31321
+    userName: admin
+    password: password
+    https: false
+    aaf: false
+  intermediaryParameters:
+    name: Participant parameters
+    reportingTimeIntervalMs: 120000
+    description: Participant Description
+    participantId:
+      name: DCAEParticipant0
+      version: 1.0.0
+    participantType:
+      name: org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipant
+      version: 2.3.4
+    clampControlLoopTopics:
+      topicSources:
+        -
+          topic: POLICY-CLRUNTIME-PARTICIPANT
+          servers:
+            - ${topicServer:message-router}
+          topicCommInfrastructure: dmaap
+          fetchTimeout: 15000
+      topicSinks:
+        -
+          topic: POLICY-CLRUNTIME-PARTICIPANT
+          servers:
+            - ${topicServer:message-router}
+          topicCommInfrastructure: dmaap
+  checkCount: 10
+  secCount: 10
+  jsonBodyConsulPath: src/main/resources/parameters/consul.json
diff --git a/packages/policy-clamp-tarball/src/main/resources/etc/KubernetesParticipantParameters.yaml b/packages/policy-clamp-tarball/src/main/resources/etc/KubernetesParticipantParameters.yaml
new file mode 100644
index 000000000..d91cc7394
--- /dev/null
+++ b/packages/policy-clamp-tarball/src/main/resources/etc/KubernetesParticipantParameters.yaml
@@ -0,0 +1,54 @@
+spring:
+  security:
+    user:
+      name: healthcheck
+      password: zb!XztG34
+security:
+  enable-csrf: false
+
+participant:
+  localChartDirectory: /var/helm-manager/local-charts
+  infoFileName: CHART_INFO.json
+  intermediaryParameters:
+    reportingTimeIntervalMs: 120000
+    description: Participant Description
+    participantId:
+      name: K8sParticipant0
+      version: 1.0.0
+    participantType:
+      name: org.onap.k8s.controlloop.K8SControlLoopParticipant
+      version: 2.3.4
+    clampControlLoopTopics:
+      topicSources:
+        -
+          topic: POLICY-CLRUNTIME-PARTICIPANT
+          servers:
+            - ${topicServer:message-router}
+          topicCommInfrastructure: dmaap
+          fetchTimeout: 15000
+      topicSinks:
+        -
+          topic: POLICY-CLRUNTIME-PARTICIPANT
+          servers:
+            - ${topicServer:message-router}
+          topicCommInfrastructure: dmaap
+
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "loggers,logfile,health,info,metrics,threaddump,heapdump"
+server:
+  # Configuration of the HTTP/REST server. The parameters are defined and handled by the springboot framework.
+  # See springboot documentation.
+  port: 8083
+
+logging:
+  # Configuration of logging
+  level:
+    ROOT: INFO
+    org.springframework: ERROR
+    org.springframework.data: ERROR
+    org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR
+  file:
+    name: /var/log/helm-manager/application.log
diff --git a/packages/policy-clamp-tarball/src/main/resources/etc/PolicyParticipantParameters.json b/packages/policy-clamp-tarball/src/main/resources/etc/PolicyParticipantParameters.json
deleted file mode 100644
index e2eb067d9..000000000
--- a/packages/policy-clamp-tarball/src/main/resources/etc/PolicyParticipantParameters.json
+++ /dev/null
@@ -1,76 +0,0 @@
-{
-    "name":"ParticipantParameterGroup",
-    "participantStatusParameters":{
-        "timeIntervalMs":10000,
-        "description":"Participant Status",
-        "participantId":{
-            "name": "PolicyParticipant0",
-            "version":"1.0.0"
-        },
-        "participantType":{
-            "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
-            "version":"2.3.1"
-        },
-        "participantDefinition":{
-            "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
-            "version":"2.3.1"
-        }
-    },
-    "intermediaryParameters": {
-        "name": "Participant parameters",
-        "reportingTimeInterval": 120000,
-        "description": "Participant Description",
-        "participantId": {
-            "name": "PolicyParticipant0",
-            "version": "1.0.0"
-        },
-        "participantType": {
-            "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant",
-            "version": "2.3.1"
-        },
-        "clampControlLoopTopics": {
-            "topicSources": [
-                {
-                    "topic": "POLICY-CLRUNTIME-PARTICIPANT",
-                    "servers": [
-                        "message-router"
-                    ],
-                    "topicCommInfrastructure": "dmaap",
-                    "fetchTimeout": 15000
-                }
-            ],
-            "topicSinks": [
-                {
-                    "topic": "POLICY-CLRUNTIME-PARTICIPANT",
-                    "servers": [
-                        "message-router"
-                    ],
-                    "topicCommInfrastructure": "dmaap"
-                },
-                {
-                    "topic": "POLICY-NOTIFICATION",
-                    "servers": [
-                        "message-router"
-                    ],
-                    "topicCommInfrastructure": "dmaap"
-                },
-                {
-                    "topic": "POLICY-NOTIFICATION",
-                    "servers": [
-                        "message-router"
-                    ],
-                    "topicCommInfrastructure": "dmaap"
-                }
-            ]
-        }
-    },
-    "databaseProviderParameters": {
-        "name": "PolicyProviderParameterGroup",
-        "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
-        "databaseDriver": "org.mariadb.jdbc.Driver",
-        "databaseUrl": "jdbc:mariadb://mariadb:3306/policyadmin",
-        "databaseUser": "policy_user",
-        "databasePassword": "policy_user",
-        "persistenceUnit": "PolicyMariaDb"
-    }
-}
diff --git a/packages/policy-clamp-tarball/src/main/resources/etc/PolicyParticipantParameters.yaml b/packages/policy-clamp-tarball/src/main/resources/etc/PolicyParticipantParameters.yaml
new file mode 100644
index 000000000..1ea5d68c0
--- /dev/null
+++ b/packages/policy-clamp-tarball/src/main/resources/etc/PolicyParticipantParameters.yaml
@@ -0,0 +1,33 @@
+
+participant:
+  policyApiParameters:
+    clientName: api
+    hostname: policy-api
+    port: 6969
+    userName: healthcheck
+    password: zb!XztG34
+    https: true
+    allowSelfSignedCerts: true
+  intermediaryParameters:
+    reportingTimeIntervalMs: 120000
+    description: Participant Description
+    participantId:
+      name: org.onap.PM_Policy
+      version: 1.0.0
+    participantType:
+      name: org.onap.policy.controlloop.PolicyControlLoopParticipant
+      version: 2.3.1
+    clampControlLoopTopics:
+      topicSources:
+        -
+          topic: POLICY-CLRUNTIME-PARTICIPANT
+          servers:
+            - ${topicServer:message-router}
+          topicCommInfrastructure: dmaap
+          fetchTimeout: 15000
+      topicSinks:
+        -
+          topic: POLICY-CLRUNTIME-PARTICIPANT
+          servers:
+            - ${topicServer:message-router}
+          topicCommInfrastructure: dmaap
-- 
cgit