Real vFW CNF config-assign and config-deploy 64/119764/11
authorLukasz Rajewski <lukasz.rajewski@orange.com>
Wed, 24 Mar 2021 18:15:31 +0000 (19:15 +0100)
committerLukasz Rajewski <lukasz.rajewski@orange.com>
Sun, 28 Mar 2021 20:21:25 +0000 (22:21 +0200)
Implementation of vFW CNF config-assign and config-deploy with
utilization of CDS native components for configuration API

Change-Id: I016b186e1fcad0bf1285292f2e93e12a1d96b63e
Issue-ID: INT-1868
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
34 files changed:
heat/vFW_CNF_CDS/automation/config.py
heat/vFW_CNF_CDS/automation/create_k8s_region.py [changed mode: 0755->0644]
heat/vFW_CNF_CDS/automation/instantiate.py
heat/vFW_CNF_CDS/templates/cba-dev/enrich.sh
heat/vFW_CNF_CDS/templates/cba-dev/run-vf-base-ra.sh
heat/vFW_CNF_CDS/templates/cba-dev/run-vf-pkg-ra.sh
heat/vFW_CNF_CDS/templates/cba-dev/run-vnf-config.sh
heat/vFW_CNF_CDS/templates/cba-dev/run-vnf-ra.sh
heat/vFW_CNF_CDS/templates/cba/Definitions/artifact_types.json
heat/vFW_CNF_CDS/templates/cba/Definitions/data_types.json
heat/vFW_CNF_CDS/templates/cba/Definitions/node_types.json
heat/vFW_CNF_CDS/templates/cba/Definitions/resources_definition_types.json
heat/vFW_CNF_CDS/templates/cba/Definitions/vFW_CNF_CDS.json
heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/CollectorScript.kt [new file with mode: 0644]
heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/ConfigDeploy.kt
heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/ConfigDeploySetup.kt
heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/SimpleErrorCheck.kt [new file with mode: 0644]
heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/SimpleStatusCheck.kt
heat/vFW_CNF_CDS/templates/cba/TOSCA-Metadata/TOSCA.meta
heat/vFW_CNF_CDS/templates/cba/Templates/base_template-mapping.json
heat/vFW_CNF_CDS/templates/cba/Templates/base_template-template.vtl
heat/vFW_CNF_CDS/templates/cba/Templates/k8s-configs/ssh-service-config/ssh-service-mapping.json
heat/vFW_CNF_CDS/templates/cba/Templates/k8s-configs/ssh-service-values/ssh-service-mapping.json [new file with mode: 0644]
heat/vFW_CNF_CDS/templates/cba/Templates/k8s-configs/ssh-service-values/values.yaml.vtl [new file with mode: 0755]
heat/vFW_CNF_CDS/templates/cba/Templates/k8s-profiles/vfw-cnf-cds-vpkg-profile/ssh-service-mapping.json
heat/vFW_CNF_CDS/templates/cba/Templates/vfw-mapping.json
heat/vFW_CNF_CDS/templates/cba/Templates/vfw-template.vtl
heat/vFW_CNF_CDS/templates/cba/Templates/vnf-mapping.json
heat/vFW_CNF_CDS/templates/cba/Templates/vnf-template.vtl
heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-mapping.json
heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-template.vtl
heat/vFW_CNF_CDS/templates/cba/Templates/vsn-mapping.json
heat/vFW_CNF_CDS/templates/cba/Templates/vsn-template.vtl
heat/vFW_CNF_CDS/templates/cba/pom.xml

index 96b098d..a7aae02 100755 (executable)
@@ -19,10 +19,10 @@ class Config:
     #### REGION DETAILS ####
     COMPLEX_ID = "complex"
     CLOUD_OWNER = "k8sCloudOwner"
-    CLOUD_REGION = "k8s-region-1"
+    CLOUD_REGION = "kud-1"
     AVAILABILITY_ZONE_NAME = "k8s-availability-zone"
     HYPERVISOR_TYPE = "k8s"
-    TENANT_NAME = "k8s-tenant-1"
+    TENANT_NAME = "kud-1"
     K8S_NAMESPACE = "vfirewall"
     CUSTOMER_RESOURCE_DEFINITIONS = []
 # Uncomment, if you want to run on non KUD k8s cluster
@@ -41,6 +41,7 @@ class Config:
 
     PROFILE_NAME = "vfw-cnf-cds-base-profile"
     PROFILE_SOURCE = PROFILE_NAME
+    RELEASE_NAME = "vfw-1"
 
     VENDOR = "vendor_cnf"
     SERVICENAME = "vfw_k8s_demo_CNF"
@@ -50,7 +51,9 @@ class Config:
     SDNC_ARTIFACT_NAME = "vnf"
 
     # INSERT PARAMS FOR VNF HERE AS "name" : "value" PAIR
-    VNF_PARAM_LIST = {}
+    VNF_PARAM_LIST = {
+        "k8s-rb-profile-namespace": K8S_NAMESPACE
+    }
 
     VF_MODULE_PREFIX = ""
     if NATIVE:
@@ -60,22 +63,22 @@ class Config:
         VF_MODULE_PREFIX + "base_template": {
             "k8s-rb-profile-name": PROFILE_NAME,
             "k8s-rb-profile-source": PROFILE_SOURCE,
-            "k8s-rb-profile-namespace": K8S_NAMESPACE
+            "k8s-rb-instance-release-name": RELEASE_NAME + "-base"
         },
         VF_MODULE_PREFIX + "vfw": {
             "k8s-rb-profile-name": PROFILE_NAME,
             "k8s-rb-profile-source": PROFILE_SOURCE,
-            "k8s-rb-profile-namespace": K8S_NAMESPACE
+            "k8s-rb-instance-release-name": RELEASE_NAME + "-vfw"
         },
         VF_MODULE_PREFIX + "vpkg": {
             "k8s-rb-profile-name": PROFILE_NAME,
             "k8s-rb-profile-source": PROFILE_SOURCE,
-            "k8s-rb-profile-namespace": K8S_NAMESPACE
+            "k8s-rb-instance-release-name": RELEASE_NAME + "-vpkg"
         },
         VF_MODULE_PREFIX + "vsn": {
             "k8s-rb-profile-name": PROFILE_NAME,
             "k8s-rb-profile-source": PROFILE_SOURCE,
-            "k8s-rb-profile-namespace": K8S_NAMESPACE
+            "k8s-rb-instance-release-name": RELEASE_NAME + "-vsn"
         }
     }
 
old mode 100755 (executable)
new mode 100644 (file)
index cfbec8c..ca680cf
@@ -21,7 +21,7 @@ from uuid import uuid4
 
 from config import Config
 from k8s_client import K8sClient
-from so_db_adapter import SoDBAdapter
+from so_db_adapter import SoDBUpdate
 from onapsdk.aai.business import Customer
 from onapsdk.aai.cloud_infrastructure import Complex, CloudRegion
 from onapsdk.msb.k8s import ConnectivityInfo
@@ -118,10 +118,9 @@ except:
 
 #### Add region to SO db ####
 logger.info("******** SO Database *******")
-so_db_adapter = SoDBAdapter(cloud_region_id=Config.CLOUD_REGION,
-                            complex_id=Config.COMPLEX_ID,
-                            onap_kubeconfig_path=Config.ONAP_KUBECONFIG_PATH)
-is_region_in_so = so_db_adapter.check_region_in_db()
-
-if not is_region_in_so:
-    so_db_adapter.add_region_to_so_db()
+result = SoDBUpdate.add_region_to_so_db(cloud_region_id=Config.CLOUD_REGION,
+                                        complex_id=Config.COMPLEX_ID)
+if result.status_code == 201:
+    logger.info("Region in SO db created successfully")
+else:
+    logger.error("Creating region in SO db failed")
index 7363c47..bfc68aa 100755 (executable)
@@ -146,7 +146,12 @@ for vnf in service.vnfs:
         profile_name = Config.VF_MODULE_PARAM_LIST[vf_module_label]["k8s-rb-profile-name"]
         try:
             profile = definition.get_profile_by_name(profile_name)
-            if profile.namespace != Config.VF_MODULE_PARAM_LIST[vf_module_label]["k8s-rb-profile-namespace"]:
+            namespace = None
+            if "k8s-rb-profile-namespace" in Config.VNF_PARAM_LIST:
+                namespace = Config.VNF_PARAM_LIST["k8s-rb-profile-namespace"]
+            if "k8s-rb-profile-namespace" in Config.VF_MODULE_PARAM_LIST[vf_module_label]:
+                namespace = Config.VF_MODULE_PARAM_LIST[vf_module_label]["k8s-rb-profile-namespace"]
+            if namespace != None and profile.namespace != namespace:
                 profile.delete()
                 logger.info("Profile: " + profile_name + " for " + vf_module.name + " deleted")
             else:
index 1db994b..632cb89 100755 (executable)
@@ -19,4 +19,5 @@
 
 curl --location --request POST 'http://127.0.0.1:8081/api/v1/blueprint-model/enrich' \
 --header 'Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==' \
+-o 'cba.zip' \
 --form 'file=@../package_native/CBA.zip' | jq
index f40760f..3046cfd 100755 (executable)
@@ -32,7 +32,7 @@ curl --location --request POST 'http://localhost:8081/api/v1/execution-service/p
     },
     "actionIdentifiers": {
         "blueprintName": "vFW_CNF_CDS",
-        "blueprintVersion": "7.0.0",
+        "blueprintVersion": "8.0.0",
         "actionName": "resource-assignment",
         "mode": "sync"
     },
index 0928329..a80238d 100755 (executable)
@@ -32,7 +32,7 @@ curl --location --request POST 'http://localhost:8081/api/v1/execution-service/p
     },
     "actionIdentifiers": {
         "blueprintName": "vFW_CNF_CDS",
-        "blueprintVersion": "7.0.0",
+        "blueprintVersion": "8.0.0",
         "actionName": "resource-assignment",
         "mode": "sync"
     },
@@ -60,6 +60,7 @@ curl --location --request POST 'http://localhost:8081/api/v1/execution-service/p
                 "k8s-rb-profile-name": "vfw-cnf-cds-base-profile",
                 "k8s-rb-profile-source": "vfw-cnf-cds-base-profile",
                 "k8s-rb-profile-namespace": "vfirewall",
+                "k8s-rb-profile-k8s-version": "1.18.9",
                 "k8s-rb-config-template-name": "ssh-service-config",
                 "k8s-rb-config-template-source": "ssh-service-config",
                 "management-prefix-id" : 3
index 1461475..d8a7ca1 100755 (executable)
@@ -32,7 +32,7 @@ curl --location --request POST 'http://localhost:8081/api/v1/execution-service/p
     },
     "actionIdentifiers": {
         "blueprintName": "vFW_CNF_CDS",
-        "blueprintVersion": "7.0.0",
+        "blueprintVersion": "8.0.0",
         "actionName": "'config-$ACTION'",
         "mode": "sync"
     },
index 1e24a7a..2d64bac 100755 (executable)
@@ -31,7 +31,7 @@ curl --location --request POST 'http://localhost:8081/api/v1/execution-service/p
     },
     "actionIdentifiers": {
         "blueprintName": "vFW_CNF_CDS",
-        "blueprintVersion": "7.0.0",
+        "blueprintVersion": "8.0.0",
         "actionName": "resource-assignment",
         "mode": "sync"
     },
@@ -49,6 +49,7 @@ curl --location --request POST 'http://localhost:8081/api/v1/execution-service/p
                 "vnf-id": "51274ece-55ca-4cbc-b7c4-0da0dcc65d38",
                 "vnf_name": "sample-vnf-name",
                 "k8s-rb-profile-namespace": "vfw-namespace",
+                "k8s-rb-profile-k8s-version": "1.18.9",
                 "int_private1_net_cidr" : "192.168.10.0/24",
                 "int_private2_net_cidr" : "192.168.20.0/24",
                 "onap_private_net_cidr" : "10.0.0.0/16",
index 77d0eb1..4211156 100644 (file)
             "description": "K8s Profile Folder Artifact",
             "version": "1.0.0",
             "derived_from": "tosca.artifacts.Implementation"
+        },
+        "artifact-k8sconfig-content": {
+            "description": "K8s Config Folder Artifact",
+            "version": "1.0.0",
+            "derived_from": "tosca.artifacts.Implementation"
         }
     }
 }
index 5fb59cf..23ae164 100644 (file)
                 },
                 "k8s-rb-profile-namespace": {
                     "description": "K8s namespace to create helm chart for specified profile",
-                    "type": "string",
-                    "default": "default"
+                    "type": "string"
                 },
                 "k8s-rb-profile-name": {
                     "description": "Profile name used in multicloud/k8s plugin to identify Helm chart(s) where this mapping is providing override values.",
                     "type": "string"
                 },
+                "k8s-rb-instance-release-name": {
+                    "description": "Name of the release for the helm package instance in k8s",
+                    "type": "string"
+                },
                 "k8s-rb-profile-source": {
                     "description": "The source folder or file relative to 'Templates/k8s-profiles' folder",
                     "type": "string"
                 },
+                "k8s-rb-profile-k8s-version": {
+                    "description": "Profile k8s version used in multicloud/k8s plugin",
+                    "type": "string"
+                },
                 "k8s-rb-config-template-name": {
                     "description": "The name of configuration template for config-assign operation",
                     "type": "string"
                     "description": "The source of configuration template for config-assign operation",
                     "type": "string"
                 },
+                "k8s-rb-config-name": {
+                    "description": "The source of configuration values for config-deploy operation",
+                    "type": "string"
+                },
+                "k8s-rb-config-value-source": {
+                    "description": "The source of configuration values for config-deploy operation",
+                    "type": "string"
+                },
                 "private1-prefix-id": {
                     "description": "",
                     "required": false,
index 95db7ae..c191f16 100644 (file)
                                     "required": false,
                                     "type": "string"
                                 },
+                                "k8s-rb-profile-k8s-version": {
+                                    "description": "a K8s cluster version for the profile",
+                                    "required": false,
+                                    "type": "string"
+                                },
                                 "k8s-rb-profile-source": {
                                     "description": "Source (tgz/folder) for the template in CBA",
                                     "required": false,
                     "operations": {
                         "process": {
                             "inputs": {
-                                "k8s-template-name": {
+                                "k8s-rb-config-template-name": {
                                     "description": "K8s template name",
                                     "required": false,
                                     "type": "string"
                                 },
-                                "k8s-config-name": {
+                                "k8s-rb-config-name": {
                                     "description": "K8s config name",
                                     "required": false,
                                     "type": "string"
                                     "required": false,
                                     "type": "string"
                                 },
-                                "k8s-rb-template-value-source": {
+                                "k8s-rb-config-value-source": {
                                     "description": "Location of value source in CBA",
                                     "required": false,
                                     "type": "string"
                                 },
-                                "k8s-operation-type": {
+                                "k8s-config-operation-type": {
                                     "required": false,
                                     "type": "string",
                                     "constraints": [
                                             "valid_values": [
                                                 "create",
                                                 "update",
-                                                "rollback"
+                                                "delete"
                                             ]
                                         }
                                     ],
index 6277e01..9975878 100644 (file)
             }
         }
     },
+    "k8s-rb-instance-release-name": {
+        "tags": "k8s, cnf, profile, k8s-rb-instance-release-name",
+        "name": "k8s-rb-instance-release-name",
+        "property": {
+            "description": "Name of the release for the helm package instance in k8s",
+            "type": "string"
+        },
+        "group": "default",
+        "updated-by": "Rajewski, Lukasz <lukasz.rajewski@orange.com>",
+        "sources": {
+            "input": {
+                "type": "source-input"
+            },
+            "default": {
+                "type": "source-default",
+                "properties": {}
+            }
+        }
+    },
     "k8s-rb-profile-namespace": {
         "tags": "k8s, cnf, profile, namespace, k8s-rb-profile-namespace",
         "name": "k8s-rb-profile-namespace",
             }
         }
     },
+    "k8s-rb-profile-k8s-version": {
+        "tags": "k8s, cnf, profile, k8s version, k8s-rb-profile-k8s-version",
+        "name": "k8s-rb-profile-k8s-version",
+        "property": {
+            "description": "Profile k8s version used in multicloud/k8s plugin",
+            "type": "string"
+        },
+        "group": "default",
+        "updated-by": "Rajewski, Lukasz <lukasz.rajewski@orange.com>",
+        "sources": {
+            "input": {
+                "type": "source-input"
+            },
+            "default": {
+                "type": "source-default",
+                "properties": {}
+            },
+            "sdnc": {
+                "type": "source-rest",
+                "properties": {
+                    "verb": "GET",
+                    "type": "JSON",
+                    "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/k8s-rb-profile-k8s-version",
+                    "path": "/param/0/value",
+                    "input-key-mapping": {
+                        "service-instance-id": "service-instance-id",
+                        "vnf-id": "vnf-id"
+                    },
+                    "output-key-mapping": {
+                        "k8s-rb-profile-k8s-version": "value"
+                    },
+                    "key-dependencies": [
+                        "service-instance-id",
+                        "vnf-id"
+                    ]
+                }
+            }
+        }
+    },
     "k8s-rb-profile-source": {
         "tags": "k8s, cnf, profile, k8s-rb-profile-source",
         "name": "k8s-rb-profile-source",
             }
         }
     },
+    "k8s-rb-config-value-source": {
+        "tags": "k8s, cnf, config, k8s-rb-config-value-source",
+        "name": "k8s-rb-config-value-source",
+        "property": {
+            "description": "The source of configuration values for config-deploy operation",
+            "type": "string"
+        },
+        "group": "default",
+        "updated-by": "Rajewski, Lukasz <lukasz.rajewski@orange.com>",
+        "sources": {
+            "input": {
+                "type": "source-input"
+            },
+            "default": {
+                "type": "source-default",
+                "properties": {}
+            }
+        }
+    },
+    "k8s-rb-config-name": {
+        "tags": "k8s, cnf, config, k8s-rb-config-name",
+        "name": "k8s-rb-config-name",
+        "property": {
+            "description": "The source of configuration values for config-deploy operation",
+            "type": "string"
+        },
+        "group": "default",
+        "updated-by": "Rajewski, Lukasz <lukasz.rajewski@orange.com>",
+        "sources": {
+            "input": {
+                "type": "source-input"
+            },
+            "default": {
+                "type": "source-default",
+                "properties": {}
+            }
+        }
+    },
     "management-prefix-id": {
         "tags": "management-prefix-id",
         "name": "management-prefix-id",
index 6c71ca2..c17caca 100644 (file)
@@ -5,7 +5,7 @@
         "author-email": "lukasz.rajewski@orange.com",
         "user-groups": "ADMIN, OPERATION",
         "template_name": "vFW_CNF_CDS",
-        "template_version": "7.0.0",
+        "template_version": "8.0.0",
         "template_tags": "Samuli Silvius, Lukasz Rajewski, vFW_CNF_CDS",
         "template_type": "DEFAULT"
     },
                         ],
                         "on_success": [
                             "config-apply"
+                        ],
+                        "on_failure": [
+                            "handle_error"
                         ]
                     },
                     "config-apply": {
                             {
                                 "call_operation": "ComponentScriptExecutor.process"
                             }
+                        ],
+                        "on_success": [
+                            "collect-results"
+                        ],
+                        "on_failure": [
+                            "handle_error"
+                        ]
+                    },
+                    "handle_error": {
+                        "description": "Simple error verification script",
+                        "target": "simple-error-check",
+                        "activities": [
+                            {
+                                "call_operation": "ComponentScriptExecutor.process"
+                            }
+                        ],
+                        "on_success": [
+                            "collect-results"
                         ]
+                    },
+                    "collect-results": {
+                        "description": "Final collection of results",
+                        "target": "collect-results"
                     }
                 },
                 "inputs": {
                 },
                 "artifacts": {
                     "ssh-service-config": {
-                        "type": "artifact-k8sprofile-content",
+                        "type": "artifact-k8sconfig-content",
                         "file": "Templates/k8s-configs/ssh-service.tar.gz"
                     },
                     "ssh-service-config-customizable": {
-                        "type": "artifact-k8sprofile-content",
+                        "type": "artifact-k8sconfig-content",
                         "file": "Templates/k8s-configs/ssh-service-config"
                     },
                     "ssh-service-config-customizable-mapping": {
                                     "artifact-prefix-names": [
                                         "helm_vpkg"
                                     ],
+                                    "k8s-config-operation-type": "create",
                                     "resource-assignment-map": {
                                         "get_attribute": [
                                             "config-setup-process",
                             }
                         }
                     }
+                },
+                "artifacts": {
+                    "ssh-service-default": {
+                        "type": "artifact-k8sconfig-content",
+                        "file": "Templates/k8s-configs/ssh-service-config/values.yaml"
+                    },
+                    "ssh-service-config": {
+                        "type": "artifact-k8sconfig-content",
+                        "file": "Templates/k8s-configs/ssh-service-values/values.yaml.vtl"
+                    },
+                    "ssh-service-config-mapping": {
+                        "type": "artifact-mapping-resource",
+                        "file": "Templates/k8s-configs/ssh-service-values/ssh-service-mapping.json"
+                    }
                 }
             },
             "simple-status-check": {
                     }
                 }
             },
+            "simple-error-check": {
+                "type": "component-script-executor",
+                "interfaces": {
+                    "ComponentScriptExecutor": {
+                        "operations": {
+                            "process": {
+                                "inputs": {
+                                    "script-type": "kotlin",
+                                    "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.SimpleErrorCheck",
+                                    "instance-dependencies": [
+                                        "blueprintPropertiesService"
+                                    ],
+                                    "dynamic-properties": "*simple-status-properties"
+                                }
+                            }
+                        }
+                    }
+                }
+            },
             "config-setup-process": {
                 "type": "component-resource-resolution",
                 "interfaces": {
                         }
                     }
                 }
+            },
+            "collect-results": {
+                "type": "component-script-executor",
+                "interfaces": {
+                    "ComponentScriptExecutor": {
+                        "operations": {
+                            "process": {
+                                "implementation": {
+                                    "primary": "component-script",
+                                    "timeout": 180,
+                                    "operation_host": "SELF"
+                                },
+                                "inputs": {
+                                    "script-type": "kotlin",
+                                    "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.CollectorScript"
+                                },
+                                "outputs": {}
+                            }
+                        }
+                    }
+                }
             }
         }
     }
diff --git a/heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/CollectorScript.kt b/heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/CollectorScript.kt
new file mode 100644 (file)
index 0000000..a9de197
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ *  Copyright Â© 2021 Bell Canada.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts
+
+import com.fasterxml.jackson.databind.JsonNode
+import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
+import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction
+import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentScriptExecutor
+import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode
+import org.onap.ccsdk.cds.controllerblueprints.core.logger
+
+open class CollectorScript : AbstractScriptComponentFunction() {
+
+    private val log = logger(CollectorScript::class)
+
+    override suspend fun processNB(executionRequest: ExecutionServiceInput) {
+        bluePrintRuntimeService.bluePrintContext()
+                .serviceTemplate.topologyTemplate!!.nodeTemplates!!
+                .keys.filter { it.startsWith("execute-script") }
+                .associateWith { responseData(it) }
+                .let { it.asJsonNode() }
+                .also { log.info("Collected results: $it") }
+                .let { setAttribute(ComponentScriptExecutor.ATTRIBUTE_RESPONSE_DATA, it) }
+    }
+
+    private fun responseData(nodeTemplateName: String): JsonNode? {
+        return try {
+            bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
+                    ComponentScriptExecutor.ATTRIBUTE_RESPONSE_DATA)
+        } catch (exception: BlueprintProcessorException) { null }
+    }
+
+    override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
+        addError(runtimeException.message ?: "Failed without error message")
+    }
+}
index 861cdf6..96b3c51 100644 (file)
@@ -30,11 +30,11 @@ open class ConfigDeploy : AbstractScriptComponentFunction() {
     }
 
     override suspend fun processNB(executionRequest: ExecutionServiceInput) {
-        val resolution_key = getDynamicProperties("resolution-key").asText()
-        log.info("Got the resolution_key: $resolution_key from config-deploy going to retrieve the data from DB")
+        val resolutionKey = getDynamicProperties("resolution-key").asText()
+        log.info("Got the resolution_key: $resolutionKey from config-deploy going to retrieve the data from DB")
         val prefix = "config-deploy" // used in the config-assign resolution
 
-        val payload = storedContentFromResolvedArtifactNB(resolution_key, prefix)
+        val payload = storedContentFromResolvedArtifactNB(resolutionKey, prefix)
         log.info("cnf configuration data from DB : \n$payload\n")
 
         println("Run config-deploy")
index 2e6ec81..f04813d 100644 (file)
@@ -19,6 +19,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts
 import com.fasterxml.jackson.databind.JsonNode
 import com.fasterxml.jackson.databind.node.ObjectNode
 import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
+import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.definition.template.K8sConfigTemplateComponent
+import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.definition.template.K8sConfigValueComponent
 import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.ResourceAssignmentProcessor
 import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
 import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
@@ -33,12 +35,12 @@ open class ConfigDeploySetup() : ResourceAssignmentProcessor() {
         return "ConfigDeploySetup"
     }
 
-    override suspend fun processNB(resourceAssignment: ResourceAssignment) {
+    override suspend fun processNB(executionRequest: ResourceAssignment) {
 
         var retValue: ObjectNode? = null
 
         try {
-            if (resourceAssignment.name == "config-deploy-setup") {
+            if (executionRequest.name == "config-deploy-setup") {
                 val modulesSdnc = raRuntimeService.getResolutionStore("vf-modules-list-sdnc")["vf-modules"]
                 val modulesAai = raRuntimeService.getResolutionStore("vf-modules-list-aai")["vf-modules"]
                 val objectMapper = jacksonObjectMapper()
@@ -46,22 +48,30 @@ open class ConfigDeploySetup() : ResourceAssignmentProcessor() {
                 for (module in modulesSdnc) {
                     val modelTopology = module.at("/vf-module-data/vf-module-topology")
                     val moduleParameters = modelTopology.at("/vf-module-parameters/param")
-                    val label: String? = getParamValueByName(moduleParameters,"vf_module_label")
+                    val label: String? = getParamValueByName(moduleParameters, "vf_module_label")
                     if (label != null) {
                         val modelInfo = modelTopology["onap-model-information"]
                         val moduleData: ObjectNode = objectMapper.createObjectNode()
                         result.put(label, moduleData)
-                        moduleData.put("k8s-rb-definition-name", modelInfo["model-invariant-uuid"].asText())
-                        moduleData.put("k8s-rb-definition-version", modelInfo["model-uuid"].asText())
-                        val templateName: String? = getParamValueByName(moduleParameters,"k8s-rb-config-template-name")
-                        val templateSource: String? = getParamValueByName(moduleParameters,"k8s-rb-config-template-source")
+                        moduleData.put(K8sConfigTemplateComponent.INPUT_K8S_DEFINITION_NAME, modelInfo["model-invariant-uuid"].asText())
+                        moduleData.put(K8sConfigTemplateComponent.INPUT_K8S_DEFINITION_VERSION, modelInfo["model-uuid"].asText())
+                        val templateName: String? = getParamValueByName(moduleParameters, K8sConfigTemplateComponent.INPUT_K8S_TEMPLATE_NAME)
+                        val templateSource: String? = getParamValueByName(moduleParameters, K8sConfigTemplateComponent.INPUT_K8S_TEMPLATE_SOURCE)
+                        val configValueSource: String? = getParamValueByName(moduleParameters, K8sConfigValueComponent.INPUT_K8S_CONFIG_VALUE_SOURCE)
+                        val configName: String? = getParamValueByName(moduleParameters, K8sConfigValueComponent.INPUT_K8S_RB_CONFIG_NAME)
+
                         if (templateName != null)
-                            moduleData.put("k8s-rb-config-template-name", templateName)
+                            moduleData.put(K8sConfigTemplateComponent.INPUT_K8S_TEMPLATE_NAME, templateName)
                         if (templateSource != null)
-                            moduleData.put("k8s-rb-config-template-source", templateSource)
+                            moduleData.put(K8sConfigTemplateComponent.INPUT_K8S_TEMPLATE_SOURCE, templateSource)
+                        if (configValueSource != null)
+                            moduleData.put(K8sConfigValueComponent.INPUT_K8S_CONFIG_VALUE_SOURCE, configValueSource)
+                        if (configName != null)
+                            moduleData.put(K8sConfigValueComponent.INPUT_K8S_RB_CONFIG_NAME, configName)
+
                         for (aaiModule in modulesAai) {
                             if (aaiModule["vf-module-id"].asText() == module["vf-module-id"].asText()) {
-                                moduleData.put("k8s-instance-id", aaiModule["heat-stack-id"].asText())
+                                moduleData.put(K8sConfigValueComponent.INPUT_K8S_INSTANCE_ID, aaiModule["heat-stack-id"].asText())
                                 break
                             }
                         }
@@ -69,12 +79,12 @@ open class ConfigDeploySetup() : ResourceAssignmentProcessor() {
                 }
                 retValue = result
             }
-            ResourceAssignmentUtils.setResourceDataValue(resourceAssignment, raRuntimeService, retValue)
+            ResourceAssignmentUtils.setResourceDataValue(executionRequest, raRuntimeService, retValue)
         } catch (e: Exception) {
             log.error(e.message, e)
-            ResourceAssignmentUtils.setResourceDataValue(resourceAssignment, raRuntimeService, "ERROR")
+            ResourceAssignmentUtils.setResourceDataValue(executionRequest, raRuntimeService, "ERROR")
 
-            throw BlueprintProcessorException("Failed in template key ($resourceAssignment) assignments, cause: ${e.message}", e)
+            throw BlueprintProcessorException("Failed in template key ($executionRequest) assignments, cause: ${e.message}", e)
         }
     }
 
@@ -87,7 +97,7 @@ open class ConfigDeploySetup() : ResourceAssignmentProcessor() {
         return null
     }
 
-    override suspend fun recoverNB(runtimeException: RuntimeException, resourceAssignment: ResourceAssignment) {
+    override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ResourceAssignment) {
         this.addError("${runtimeException.message}")
     }
 }
diff --git a/heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/SimpleErrorCheck.kt b/heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/SimpleErrorCheck.kt
new file mode 100644 (file)
index 0000000..8e4a58a
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright Â© 2021 Orange
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts
+
+import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
+import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction
+import org.slf4j.LoggerFactory
+
+open class SimpleErrorCheck : AbstractScriptComponentFunction() {
+
+    private val log = LoggerFactory.getLogger(SimpleErrorCheck::class.java)!!
+
+    override fun getName(): String {
+        return "SimpleErrorCheck"
+    }
+
+    override suspend fun processNB(executionRequest: ExecutionServiceInput) {
+        log.info("SIMPLE ERROR CHECK - START")
+
+        log.info("SIMPLE ERROR CHECK - END")
+    }
+
+    override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
+        log.info("Executing Recovery")
+        this.addError("${runtimeException.message}")
+    }
+}
index c775bb1..9033064 100644 (file)
@@ -44,16 +44,16 @@ open class SimpleStatusCheck : AbstractScriptComponentFunction() {
 
         val k8sConfiguration = K8sConnectionPluginConfiguration(bluePrintPropertiesService)
 
-        var instanceApi = K8sPluginInstanceApi(k8sConfiguration)
+        val instanceApi = K8sPluginInstanceApi(k8sConfiguration)
 
         var checkCount: Int = 30 // in the future to be read in from the input
-        while(checkCount > 0) {
+        while (checkCount > 0) {
             var continueCheck = false
             configValueSetup.fields().forEach { it ->
                 val vfModuleName = it.key
                 val instanceName = it.value.get("k8s-instance-id").asText()
 
-                var instanceStatus: K8sRbInstanceStatus? = instanceApi.getInstanceStatus(instanceName)
+                val instanceStatus: K8sRbInstanceStatus? = instanceApi.getInstanceStatus(instanceName)
                 instanceStatus?.resourcesStatus?.forEach {
                     if (it.gvk?.kind == "Pod") {
                         var version = it.gvk?.version!!
@@ -61,11 +61,11 @@ open class SimpleStatusCheck : AbstractScriptComponentFunction() {
                             version = "${it.gvk?.group}/$version"
                         // val podStatus = instanceApi.queryInstanceStatus(instanceName, it.gvk?.kind!!, version, it.name, null)
                         // log.info(podStatus.toString())
-                        var podState = it.status?.get("status") as Map<String, Object>
+                        val podState = it.status?.get("status") as Map<String, Object>
 
-                        if ((podState?.get("phase") as String) != "Running") {
+                        if ((podState["phase"] as String) != "Running") {
                             continueCheck = true
-                            log.info("Pod ${it?.name} [$vfModuleName] has invalid state ${(podState?.get("phase"))}")
+                            log.info("Pod ${it.name} [$vfModuleName] has invalid state ${(podState["phase"])}")
                         }
                     }
                 }
index fd11bfb..d9020e5 100644 (file)
@@ -3,6 +3,6 @@ CSAR-Version: 1.0
 Created-By: Samuli Silvius <s.silvius@partner.samsung.com>
 Entry-Definitions: Definitions/vFW_CNF_CDS.json
 Template-Name: vFW_CNF_CDS
-Template-Version: 7.0.0
+Template-Version: 8.0.0
 Template-Type: DEFAULT
 Template-Tags: Samuli Silvius, Lukasz Rajewski, vFW_CNF_CDS
index d25f741..686f418 100644 (file)
         "input-param": false,
         "dictionary-name": "k8s-rb-profile-namespace",
         "dictionary-source": "sdnc",
-        "dependencies": []
+        "dependencies": [
+            "service-instance-id",
+            "vnf-id"
+        ]
+    },
+    {
+        "name": "k8s-rb-profile-k8s-version",
+        "property": {
+            "description": "K8s cluster version to create helm chart for specified RB profile",
+            "type": "string",
+            "required": false,
+            "default": "1.18.9"
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-profile-k8s-version",
+        "dictionary-source": "sdnc",
+        "dependencies": [
+            "service-instance-id",
+            "vnf-id"
+        ]
     },
     {
         "name": "k8s-rb-profile-name",
         "dictionary-source": "default",
         "dependencies": []
     },
+    {
+        "name": "k8s-rb-instance-release-name",
+        "property": {
+            "description": "Name of the release for the helm package instance in k8s",
+            "type": "string",
+            "required": false,
+            "default": "base"
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-instance-release-name",
+        "dictionary-source": "default",
+        "dependencies": []
+    },
     {
         "name": "k8s-rb-definition-name",
         "property": {
         "dictionary-name": "k8s-rb-config-template-source",
         "dictionary-source": "default",
         "dependencies": []
+    },
+    {
+        "name": "k8s-rb-config-name",
+        "property": {
+            "description": "The source of configuration values for config-deploy operation",
+            "type": "string",
+            "required": false
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-config-name",
+        "dictionary-source": "default",
+        "dependencies": []
+    },
+    {
+        "name": "k8s-rb-config-value-source",
+        "property": {
+            "description": "The source of configuration values for config-deploy operation",
+            "type": "string",
+            "required": false
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-config-value-source",
+        "dictionary-source": "default",
+        "dependencies": []
     }
 ]
index a6bc57b..4d1b46a 100644 (file)
         }
     ],
     "resource-accumulator-resolved-data": [
+        {
+            "param-name": "vnf_name",
+            "param-value": "${vnf_name}"
+        },
 ##RB name
         {
             "param-name": "vf-module-model-invariant-uuid",
             "param-name": "vf-module-model-version",
             "param-value": "${vf-module-model-version}"
         },
+##Release name
+        {
+            "param-name": "k8s-rb-instance-release-name",
+            "param-value": "${k8s-rb-instance-release-name}"
+        },
+##Profile name
         {
             "param-name": "k8s-rb-profile-name",
             "param-value": "${k8s-rb-profile-name}"
         {
             "param-name": "onap_private_subnet_id",
             "param-value": "management-network-subnet-1"
+        },
+        {
+            "param-name": "k8s-rb-config-template-name",
+            "param-value": "${k8s-rb-config-template-name}"
+        },
+        {
+            "param-name": "k8s-rb-config-template-source",
+            "param-value": "${k8s-rb-config-template-source}"
+        },
+        {
+            "param-name": "k8s-rb-config-name",
+            "param-value": "${k8s-rb-config-name}"
+        },
+        {
+            "param-name": "k8s-rb-config-value-source",
+            "param-value": "${k8s-rb-config-value-source}"
         }
     ]
 }
index 47db31d..4fd287f 100644 (file)
@@ -4,7 +4,7 @@
         "property": {
             "description": "The number of node port for ssh service of vpg",
             "type": "integer",
-            "default": "0"
+            "default": 31922
         },
         "input-param": false,
         "dictionary-name": "vpg-management-port",
diff --git a/heat/vFW_CNF_CDS/templates/cba/Templates/k8s-configs/ssh-service-values/ssh-service-mapping.json b/heat/vFW_CNF_CDS/templates/cba/Templates/k8s-configs/ssh-service-values/ssh-service-mapping.json
new file mode 100644 (file)
index 0000000..4fd287f
--- /dev/null
@@ -0,0 +1,14 @@
+[
+    {
+        "name": "vpg-management-port",
+        "property": {
+            "description": "The number of node port for ssh service of vpg",
+            "type": "integer",
+            "default": 31922
+        },
+        "input-param": false,
+        "dictionary-name": "vpg-management-port",
+        "dictionary-source": "default",
+        "dependencies": []
+    }
+]
diff --git a/heat/vFW_CNF_CDS/templates/cba/Templates/k8s-configs/ssh-service-values/values.yaml.vtl b/heat/vFW_CNF_CDS/templates/cba/Templates/k8s-configs/ssh-service-values/values.yaml.vtl
new file mode 100755 (executable)
index 0000000..f636e8f
--- /dev/null
@@ -0,0 +1,3 @@
+vnf_name: test-vnf
+vpg_name_0: test-vnf-vpg
+vpg_management_port: ${vpg-management-port}
index 47db31d..d5ab945 100644 (file)
@@ -4,7 +4,7 @@
         "property": {
             "description": "The number of node port for ssh service of vpg",
             "type": "integer",
-            "default": "0"
+            "default": 0
         },
         "input-param": false,
         "dictionary-name": "vpg-management-port",
index ac08388..f5d7ac0 100644 (file)
         "input-param": false,
         "dictionary-name": "k8s-rb-profile-namespace",
         "dictionary-source": "sdnc",
-        "dependencies": []
+        "dependencies": [
+            "service-instance-id",
+            "vnf-id"
+        ]
+    },
+    {
+        "name": "k8s-rb-profile-k8s-version",
+        "property": {
+            "description": "K8s cluster version to create helm chart for specified RB profile",
+            "type": "string",
+            "required": false,
+            "default": "1.18.9"
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-profile-k8s-version",
+        "dictionary-source": "sdnc",
+        "dependencies": [
+            "service-instance-id",
+            "vnf-id"
+        ]
     },
     {
         "name": "k8s-rb-profile-name",
         "dictionary-source": "default",
         "dependencies": []
     },
+    {
+        "name": "k8s-rb-instance-release-name",
+        "property": {
+            "description": "Name of the release for the helm package instance in k8s",
+            "type": "string",
+            "required": false,
+            "default": "vfw"
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-instance-release-name",
+        "dictionary-source": "default",
+        "dependencies": []
+    },
     {
         "name": "k8s-rb-definition-name",
         "property": {
         "dictionary-name": "k8s-rb-config-template-source",
         "dictionary-source": "default",
         "dependencies": []
+    },
+    {
+        "name": "k8s-rb-config-name",
+        "property": {
+            "description": "The source of configuration values for config-deploy operation",
+            "type": "string",
+            "required": false
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-config-name",
+        "dictionary-source": "default",
+        "dependencies": []
+    },
+    {
+        "name": "k8s-rb-config-value-source",
+        "property": {
+            "description": "The source of configuration values for config-deploy operation",
+            "type": "string",
+            "required": false
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-config-value-source",
+        "dictionary-source": "default",
+        "dependencies": []
     }
 ]
index 55f9451..4702f15 100644 (file)
@@ -98,7 +98,7 @@
                     "output-key-mapping": [
                         {
                             "resource-name": "vfw_name_0",
-                            "resource-value": "${vf_module_name}"
+                            "resource-value": "${k8s-rb-instance-release-name}"
                         }
                     ]
                 }
         }
     ],
     "resource-accumulator-resolved-data": [
+        {
+            "param-name": "vnf_name",
+            "param-value": "${vnf_name}"
+        },
 ##RB name
         {
             "param-name": "vf-module-model-invariant-uuid",
             "param-name": "vf-module-model-version",
             "param-value": "${vf-module-model-version}"
         },
+##Release name
+        {
+            "param-name": "k8s-rb-instance-release-name",
+            "param-value": "${k8s-rb-instance-release-name}"
+        },
+##Profile name
         {
             "param-name": "k8s-rb-profile-name",
             "param-value": "${k8s-rb-profile-name}"
+        },
+        {
+            "param-name": "k8s-rb-config-template-name",
+            "param-value": "${k8s-rb-config-template-name}"
+        },
+        {
+            "param-name": "k8s-rb-config-template-source",
+            "param-value": "${k8s-rb-config-template-source}"
+        },
+        {
+            "param-name": "k8s-rb-config-name",
+            "param-value": "${k8s-rb-config-name}"
+        },
+        {
+            "param-name": "k8s-rb-config-value-source",
+            "param-value": "${k8s-rb-config-value-source}"
         }
     ]
 }
index c6411d7..b764a13 100644 (file)
         "dictionary-name": "k8s-rb-profile-namespace",
         "dictionary-source": "default",
         "dependencies": []
+    },
+    {
+        "name": "k8s-rb-profile-k8s-version",
+        "property": {
+            "description": "K8s cluster version to create helm chart for specified RB profile",
+            "type": "string",
+            "required": false,
+            "default": "1.18.9"
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-profile-k8s-version",
+        "dictionary-source": "default",
+        "dependencies": []
     }
 ]
index 9e23665..9f6e96a 100644 (file)
         {
             "param-name": "demo_artifacts_version",
             "param-value": "${demo_artifacts_version}"
+        },
+        {
+            "param-name": "k8s-rb-profile-namespace",
+            "param-value": "${k8s-rb-profile-namespace}"
+        },
+        {
+            "param-name": "k8s-rb-profile-k8s-version",
+            "param-value": "${k8s-rb-profile-k8s-version}"
         }
     ]
 }
index 5156be3..9008c88 100644 (file)
         "input-param": false,
         "dictionary-name": "k8s-rb-profile-namespace",
         "dictionary-source": "sdnc",
-        "dependencies": []
+        "dependencies": [
+            "service-instance-id",
+            "vnf-id"
+        ]
+    },
+    {
+        "name": "k8s-rb-profile-k8s-version",
+        "property": {
+            "description": "K8s cluster version to create helm chart for specified RB profile",
+            "type": "string",
+            "required": false,
+            "default": "1.18.9"
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-profile-k8s-version",
+        "dictionary-source": "sdnc",
+        "dependencies": [
+            "service-instance-id",
+            "vnf-id"
+        ]
     },
     {
         "name": "k8s-rb-profile-name",
         "dictionary-source": "default",
         "dependencies": []
     },
+    {
+        "name": "k8s-rb-instance-release-name",
+        "property": {
+            "description": "Name of the release for the helm package instance in k8s",
+            "type": "string",
+            "required": false,
+            "default": "vpkg"
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-instance-release-name",
+        "dictionary-source": "default",
+        "dependencies": []
+    },
     {
         "name": "k8s-rb-definition-name",
         "property": {
         "dictionary-name": "k8s-rb-config-template-source",
         "dictionary-source": "default",
         "dependencies": []
+    },
+    {
+        "name": "k8s-rb-config-name",
+        "property": {
+            "description": "The source of configuration values for config-deploy operation",
+            "type": "string",
+            "required": false
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-config-name",
+        "dictionary-source": "default",
+        "dependencies": []
+    },
+    {
+        "name": "k8s-rb-config-value-source",
+        "property": {
+            "description": "The source of configuration values for config-deploy operation",
+            "type": "string",
+            "required": false
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-config-value-source",
+        "dictionary-source": "default",
+        "dependencies": []
     }
 ]
index 2a6b798..da7b271 100644 (file)
@@ -98,7 +98,7 @@
                     "output-key-mapping": [
                         {
                             "resource-name": "vpg_name_0",
-                            "resource-value": "${vf_module_name}"
+                            "resource-value": "${k8s-rb-instance-release-name}"
                         }
                     ]
                 }
         }
     ],
     "resource-accumulator-resolved-data": [
+        {
+            "param-name": "vnf_name",
+            "param-value": "${vnf_name}"
+        },
 ##RB name
         {
             "param-name": "vf-module-model-invariant-uuid",
             "param-name": "vf-module-model-version",
             "param-value": "${vf-module-model-version}"
         },
+##Release name
+        {
+            "param-name": "k8s-rb-instance-release-name",
+            "param-value": "${k8s-rb-instance-release-name}"
+        },
+##Profile name
         {
             "param-name": "k8s-rb-profile-name",
             "param-value": "${k8s-rb-profile-name}"
+        },
+        {
+            "param-name": "k8s-rb-config-template-name",
+            "param-value": "${k8s-rb-config-template-name}"
+        },
+        {
+            "param-name": "k8s-rb-config-template-source",
+            "param-value": "${k8s-rb-config-template-source}"
+        },
+        {
+            "param-name": "k8s-rb-config-name",
+            "param-value": "${k8s-rb-config-name}"
+        },
+        {
+            "param-name": "k8s-rb-config-value-source",
+            "param-value": "${k8s-rb-config-value-source}"
         }
     ]
 }
index d8bb571..ead5e29 100644 (file)
         "input-param": false,
         "dictionary-name": "k8s-rb-profile-namespace",
         "dictionary-source": "sdnc",
-        "dependencies": []
+        "dependencies": [
+            "service-instance-id",
+            "vnf-id"
+        ]
+    },
+    {
+        "name": "k8s-rb-profile-k8s-version",
+        "property": {
+            "description": "K8s cluster version to create helm chart for specified RB profile",
+            "type": "string",
+            "required": false,
+            "default": "1.18.9"
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-profile-k8s-version",
+        "dictionary-source": "sdnc",
+        "dependencies": [
+            "service-instance-id",
+            "vnf-id"
+        ]
     },
     {
         "name": "k8s-rb-profile-name",
         "dictionary-source": "default",
         "dependencies": []
     },
+    {
+        "name": "k8s-rb-instance-release-name",
+        "property": {
+            "description": "Name of the release for the helm package instance in k8s",
+            "type": "string",
+            "required": false,
+            "default": "vsn"
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-instance-release-name",
+        "dictionary-source": "default",
+        "dependencies": []
+    },
     {
         "name": "k8s-rb-definition-name",
         "property": {
         "dictionary-name": "k8s-rb-config-template-source",
         "dictionary-source": "default",
         "dependencies": []
+    },
+    {
+        "name": "k8s-rb-config-name",
+        "property": {
+            "description": "The source of configuration values for config-deploy operation",
+            "type": "string",
+            "required": false
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-config-name",
+        "dictionary-source": "default",
+        "dependencies": []
+    },
+    {
+        "name": "k8s-rb-config-value-source",
+        "property": {
+            "description": "The source of configuration values for config-deploy operation",
+            "type": "string",
+            "required": false
+        },
+        "input-param": false,
+        "dictionary-name": "k8s-rb-config-value-source",
+        "dictionary-source": "default",
+        "dependencies": []
     }
 ]
index 4768ab8..61ba093 100644 (file)
@@ -98,7 +98,7 @@
                     "output-key-mapping": [
                         {
                             "resource-name": "vsn_name_0",
-                            "resource-value": "${vf_module_name}"
+                            "resource-value": "${k8s-rb-instance-release-name}"
                         }
                     ]
                 }
         }
     ],
     "resource-accumulator-resolved-data": [
+        {
+            "param-name": "vnf_name",
+            "param-value": "${vnf_name}"
+        },
 ##RB name
         {
             "param-name": "vf-module-model-invariant-uuid",
             "param-name": "vf-module-model-version",
             "param-value": "${vf-module-model-version}"
         },
+##Release name
+        {
+            "param-name": "k8s-rb-instance-release-name",
+            "param-value": "${k8s-rb-instance-release-name}"
+        },
+##Profile name
         {
             "param-name": "k8s-rb-profile-name",
             "param-value": "${k8s-rb-profile-name}"
+        },
+        {
+            "param-name": "k8s-rb-config-template-name",
+            "param-value": "${k8s-rb-config-template-name}"
+        },
+        {
+            "param-name": "k8s-rb-config-template-source",
+            "param-value": "${k8s-rb-config-template-source}"
+        },
+        {
+            "param-name": "k8s-rb-config-name",
+            "param-value": "${k8s-rb-config-name}"
+        },
+        {
+            "param-name": "k8s-rb-config-value-source",
+            "param-value": "${k8s-rb-config-value-source}"
         }
     ]
 }
index 26bf93e..fdb149e 100644 (file)
 
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
+    <dependencies>
+        <dependency>
+            <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+            <artifactId>processor-core</artifactId>
+            <version>1.1.1-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId>
+            <artifactId>k8s-connection-plugin</artifactId>
+            <version>1.1.1-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
 
     <parent>
         <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>