From 3d170c6e14976549cd2edc405c5c242110bff2ff Mon Sep 17 00:00:00 2001
From: Sirisha_Manchikanti <sirisha.manchikanti@est.tech>
Date: Tue, 14 Dec 2021 18:12:07 +0000
Subject: Add ControlLoop distribution to runtime

This commit unpacks the csar received either from SDC or for local
verification from file-system, prepares the toscaservicetemplate with
needed node-types and data-types, forwards the template to controlloop
runtime components for commisioning of controlloop.

Issue-ID: POLICY-3808
Signed-off-by: Sirisha_Manchikanti <sirisha.manchikanti@est.tech>
Change-Id: Ib3600542aca7b32ae19242c2f924bdaf2ab870a8
---
 .../src/main/resources/etc/defaultConfig.json      | 37 +++++++++++++++++++---
 .../src/main/resources/etc/s3pConfig.json          | 37 +++++++++++++++++++---
 2 files changed, 66 insertions(+), 8 deletions(-)

(limited to 'packages')

diff --git a/packages/policy-distribution-tarball/src/main/resources/etc/defaultConfig.json b/packages/policy-distribution-tarball/src/main/resources/etc/defaultConfig.json
index bda3b11f..4c14f75b 100644
--- a/packages/policy-distribution-tarball/src/main/resources/etc/defaultConfig.json
+++ b/packages/policy-distribution-tarball/src/main/resources/etc/defaultConfig.json
@@ -19,13 +19,23 @@
                         "decoderType": "ToscaPolicyDecoder",
                         "decoderClassName": "org.onap.policy.distribution.reception.decoding.policy.file.PolicyDecoderFileInCsarToPolicy",
                         "decoderConfigurationName": "toscaPolicyDecoderConfiguration"
+                    },
+                    "ToscaControlLoopDecoder": {
+                        "decoderType": "ToscaControlLoopDecoder",
+                        "decoderClassName": "org.onap.policy.distribution.reception.decoding.policy.file.ControlLoopDecoderFileInCsar",
+                        "decoderConfigurationName": "toscaControlLoopDecoderConfiguration"
                     }
                 },
                 "policyForwarders": {
-                    "LifeCycleApiForwarder": {
-                        "forwarderType": "LifeCycleAPI",
+                    "LifeCycleApiPolicyForwarder": {
+                        "forwarderType": "LifeCyclePolicyAPI",
                         "forwarderClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiPolicyForwarder",
-                        "forwarderConfigurationName": "lifecycleApiConfiguration"
+                        "forwarderConfigurationName": "lifecycleApiPolicyConfiguration"
+                    },
+                    "LifeCycleApiControlLoopForwarder": {
+                        "forwarderType": "LifeCycleControlLoopAPI",
+                        "forwarderClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiControlLoopForwarder",
+                        "forwarderConfigurationName": "lifecycleApiControlLoopConfiguration"
                     }
                 }
             }
@@ -65,10 +75,16 @@
                 "policyFileName": "tosca_policy",
                 "policyTypeFileName": "tosca_policy_type"
             }
+        },
+        "toscaControlLoopDecoderConfiguration": {
+            "parameterClassName": "org.onap.policy.distribution.reception.decoding.policy.file.ControlLoopDecoderFileInCsarParameterGroup",
+            "parameters": {
+                "controlLoopType": "controlloop"
+            }
         }
     },
     "policyForwarderConfigurationParameters": {
-        "lifecycleApiConfiguration": {
+        "lifecycleApiPolicyConfiguration": {
             "parameterClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiForwarderParameters",
             "parameters": {
                 "apiParameters": {
@@ -89,6 +105,19 @@
                 },
                 "deployPolicies": true
             }
+        },
+        "lifecycleApiControlLoopConfiguration": {
+            "parameterClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiControlLoopForwarderParameters",
+            "parameters": {
+                "controlLoopRuntimeParameters": {
+                    "clientName": "policy-clamp-cl-runtime",
+                    "hostname": "policy-clamp-cl-runtime",
+                    "port": 6969,
+                    "useHttps": true,
+                    "userName": "policyadmin",
+                    "password": "zb!XztG34"
+                }
+            }
         }
     }
 }
diff --git a/packages/policy-distribution-tarball/src/main/resources/etc/s3pConfig.json b/packages/policy-distribution-tarball/src/main/resources/etc/s3pConfig.json
index 7059f5b4..cea48547 100644
--- a/packages/policy-distribution-tarball/src/main/resources/etc/s3pConfig.json
+++ b/packages/policy-distribution-tarball/src/main/resources/etc/s3pConfig.json
@@ -17,13 +17,23 @@
                         "decoderType": "ToscaPolicyDecoder",
                         "decoderClassName": "org.onap.policy.distribution.reception.decoding.policy.file.PolicyDecoderFileInCsarToPolicy",
                         "decoderConfigurationName": "toscaPolicyDecoderConfiguration"
+                    },
+                "ToscaControlLoopDecoder": {
+                        "decoderType": "ToscaControlLoopDecoder",
+                        "decoderClassName": "org.onap.policy.distribution.reception.decoding.policy.file.ControlLoopDecoderFileInCsar",
+                        "decoderConfigurationName": "toscaControlLoopDecoderConfiguration"
                     }
                 },
                 "policyForwarders": {
-                    "LifeCycleApiForwarder": {
-                        "forwarderType": "LifeCycleAPI",
+                    "LifeCycleApiPolicyForwarder": {
+                        "forwarderType": "LifeCyclePolicyAPI",
                         "forwarderClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiPolicyForwarder",
-                        "forwarderConfigurationName": "lifecycleApiConfiguration"
+                        "forwarderConfigurationName": "lifecycleApiPolicyConfiguration"
+                    },
+                    "LifeCycleApiControlLoopForwarder": {
+                        "forwarderType": "LifeCycleControlLoopAPI",
+                        "forwarderClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiControlLoopForwarder",
+                        "forwarderConfigurationName": "lifecycleApiControlLoopConfiguration"
                     }
                 }
             }
@@ -44,10 +54,16 @@
                 "policyFileName": "tosca_policy",
                 "policyTypeFileName": "tosca_policy_type"
             }
+        },
+        "toscaControlLoopDecoderConfiguration": {
+            "parameterClassName": "org.onap.policy.distribution.reception.decoding.policy.file.ControlLoopDecoderFileInCsarParameterGroup",
+            "parameters": {
+                "controlLoopType": "controlloop"
+            }
         }
     },
     "policyForwarderConfigurationParameters": {
-        "lifecycleApiConfiguration": {
+        "lifecycleApiPolicyConfiguration": {
             "parameterClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiForwarderParameters",
             "parameters": {
                 "apiParameters": {
@@ -68,6 +84,19 @@
                 },
                 "deployPolicies": true
             }
+        },
+        "lifecycleApiControlLoopConfiguration": {
+            "parameterClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiControlLoopForwarderParameters",
+            "parameters": {
+                "controlLoopRuntimeParameters": {
+                    "clientName": "policy-clamp-cl-runtime",
+                    "hostname": "policy-clamp-cl-runtime",
+                    "port": 6969,
+                    "useHttps": true,
+                    "userName": "policyadmin",
+                    "password": "zb!XztG34"
+                }
+            }
         }
     }
 }
-- 
cgit 1.2.3-korg