diff options
Diffstat (limited to 'components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS')
33 files changed, 1459 insertions, 2160 deletions
diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Scripts/kotlin/KotlinDayOneConfig.kt b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Scripts/kotlin/KotlinDayOneConfig.kt index 9e2b46398..1e13ec048 100644 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Scripts/kotlin/KotlinDayOneConfig.kt +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Scripts/kotlin/KotlinDayOneConfig.kt @@ -1,6 +1,6 @@ /* * Copyright © 2019 TechMahindra -* Author: Malinconico Aniello Paolo, Vamshi Namilikonda, Thamlur Raju +* * 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 @@ -20,6 +20,8 @@ import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.node.ObjectNode +import com.fasterxml.jackson.databind.JsonNode +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import java.io.File import java.nio.file.Path import java.nio.file.Paths @@ -36,8 +38,13 @@ import org.onap.ccsdk.cds.blueprintsprocessor.rest.BasicAuthRestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BasicAuthRestClientService import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService +import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.definition.K8sPluginDefinitionApi +import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.K8sConnectionPluginConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.definition.K8sDefinitionRestClient import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.RestLoggerService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction +import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.contentFromResolvedArtifactNB import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.utils.ArchiveType import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintArchiveUtils @@ -51,6 +58,7 @@ import org.springframework.web.client.RestTemplate import org.yaml.snakeyaml.Yaml import java.util.ArrayList import java.io.IOException + import java.util.Base64 import java.nio.charset.Charset import java.nio.file.Files @@ -80,137 +88,137 @@ open class DayOneConfig : AbstractScriptComponentFunction() { val aaiApiUsername = getDynamicProperties("aai-access").get("username").asText() val aaiApiPassword = getDynamicProperties("aai-access").get("password").asText() - log.info("AAI params $aaiApiUrl") - val resolution_key = getDynamicProperties("resolution-key").asText() - val payload = storedContentFromResolvedArtifactNB(resolution_key, prefix) + log.info("AAI params $aaiApiUrl") - val payloadObject = JacksonUtils.jsonNode(payload) as ObjectNode - val serviceInstanceID: String = getResolvedParameter(payloadObject, "service-instance-id") - val vnfID: String = getResolvedParameter(payloadObject, "vnf-id") - log.info("Get serviceInstanceID $serviceInstanceID") - log.info("Get vnfID $vnfID") - val vnfUrl = aaiApiUrl + "/aai/v19/network/generic-vnfs/generic-vnf/" + vnfID + "/vf-modules"; + val resolution_key = getDynamicProperties("resolution-key").asText() - val mapOfHeaders = hashMapOf<String, String>() - mapOfHeaders.put("Accept", "application/json") - mapOfHeaders.put("Content-Type", "application/json") - mapOfHeaders.put("x-FromAppId", "SO") - mapOfHeaders.put("X-TransactionId", "get_aai_subscr") - val basicAuthRestClientProperties: BasicAuthRestClientProperties = BasicAuthRestClientProperties() - basicAuthRestClientProperties.username = aaiApiUsername - basicAuthRestClientProperties.password = aaiApiPassword - basicAuthRestClientProperties.url = vnfUrl - basicAuthRestClientProperties.additionalHeaders =mapOfHeaders - val basicAuthRestClientService: BasicAuthRestClientService= BasicAuthRestClientService(basicAuthRestClientProperties) - try { - val resultOfGet: BlueprintWebClientService.WebClientResponse<String> = basicAuthRestClientService.exchangeResource(HttpMethod.GET.name, "", "") + val sdnc_payload:String = contentFromResolvedArtifactNB("config-deploy-sdnc") + //log.info("SDNC payload $sdnc_payload") + val sdnc_payloadObject = JacksonUtils.jsonNode(sdnc_payload) as ObjectNode - val aaiBody = resultOfGet.body - val aaiPayloadObject = JacksonUtils.jsonNode(aaiBody) as ObjectNode - for (item in aaiPayloadObject.get("vf-module")) { + val aai_payload:String = contentFromResolvedArtifactNB("config-deploy-aai") + //log.info("AAI payload $aai_payload") + val aai_payloadObject = JacksonUtils.jsonNode(aai_payload) as ObjectNode - log.info("item payload Deatils : $item") - val isItBaseVfModule = item.get("is-base-vf-module").asText() - if(isItBaseVfModule.toBoolean()) - continue - val vfModuleID: String = item.get("vf-module-id").asText() - log.info("AAI Vf-module ID is : $vfModuleID") - val vfModuleInvariantID: String = item.get("model-invariant-id").asText() + try { - log.info("AAI Vf-module Invariant ID is : $vfModuleInvariantID") + for (item in sdnc_payloadObject.get("vf-modules")){ - val vfModuleUUID: String = item.get("model-version-id").asText() + var instanceID:String ="" + val modelTopology = item.get("vf-module-data").get("vf-module-topology") - log.info("AAI Vf-module UUID is : $vfModuleUUID") - val vfModuleInstance: String = item.get("heat-stack-id").asText() - log.info("AAI Vf-module Heat Stack ID : $vfModuleInstance") + val moduleParameters = modelTopology.get("vf-module-parameters").get("param") - var delimiter = "/" + val label: String? = getParamValueByName(moduleParameters, "vf-module-label") + val modelInfo = modelTopology.get("onap-model-information") + val vfModuleInvariantID = modelInfo.get("model-invariant-uuid").asText() + log.info("VF MOdule Inavriant ID $vfModuleInvariantID") + val vfModuleCustID=modelInfo.get("model-customization-uuid").asText() + val vfModuleUUID=modelInfo.get("model-uuid").asText() + val idInfo = modelTopology.get("vf-module-topology-identifier") + val vfModuleID = idInfo.get("vf-module-id").asText() + for (aai_item in aai_payloadObject.get("vf-modules")) + { + if (aai_item.get("vf-module-id").asText() == vfModuleID && aai_item.get("heat-stack-id") != null) + { + instanceID=aai_item.get("heat-stack-id").asText() + break + } + } - val Instance = vfModuleInstance.split(delimiter) - val instanceName = Instance[0] - val instanceID = Instance[1] - log.info("instance name is : $instanceName") - log.info("K8S instance ID is : $instanceID") - val instanceNameNameArray: List<String> = instanceName.split("..") - val typOfVfmodule = instanceNameNameArray[1] - log.info("Type of vf-module: $typOfVfmodule") val k8sRbProfileName: String = "profile_" + vfModuleID - val k8sConfigTemplateName: String = "template_" + vfModuleID + val k8sConfigTemplateName: String = "template_" + vfModuleCustID - val api = K8sConfigTemplateApi(k8sApiUsername, k8sApiPassword, baseK8sApiUrl, vfModuleInvariantID, vfModuleUUID, k8sConfigTemplateName) + val api = K8sConfigTemplateApi(k8sApiUsername, k8sApiPassword, baseK8sApiUrl, vfModuleInvariantID, vfModuleCustID, k8sConfigTemplateName) // Check if definition exists if (!api.hasDefinition()) { - throw BluePrintProcessorException("K8s Config Template ($vfModuleInvariantID/$vfModuleUUID) - $k8sConfigTemplateName not found ") + throw BluePrintProcessorException("K8S Definition ($vfModuleInvariantID/$vfModuleCustID) not found ") } + val bluePrintPropertiesService: BluePrintPropertiesService =this.functionDependencyInstanceAsType("bluePrintPropertiesService") + val k8sConfiguration = K8sConnectionPluginConfiguration(bluePrintPropertiesService) + val rbDefinitionService = K8sDefinitionRestClient(k8sConfiguration,vfModuleInvariantID, vfModuleCustID) + + + val def: BlueprintWebClientService.WebClientResponse<String> = rbDefinitionService.exchangeResource(HttpMethod.GET.name,"","") + log.info(def.body.toString()) + val rbdef = JacksonUtils.jsonNode(def.body.toString()) as ObjectNode + val chartName = rbdef.get("chart-name").asText() log.info("Config Template name: $k8sConfigTemplateName") - if (k8sRbProfileName.equals("")) { - throw BluePrintProcessorException("K8s rb profile name is empty! Either define profile name to use or choose default") - } + var configTemplate = K8sConfigTemplate() configTemplate.templateName = k8sConfigTemplateName configTemplate.description = " " - configTemplate.ChartName = typOfVfmodule + configTemplate.ChartName = chartName log.info("Chart name: ${configTemplate.ChartName}") - val instanceAPI = K8sInstanceApi(k8sApiUsername, k8sApiPassword, baseK8sApiUrl, vfModuleInvariantID, vfModuleUUID) - val configMapName: String = instanceAPI.getInsnceDetails(instanceID, typOfVfmodule) - - log.info("configmap retrieved " +typOfVfmodule+ "vfmodule ->"+ configMapName) - modifyTemplate(configMapName, typOfVfmodule) - val configTemplateFile: Path = prepareConfigTemplateJson(k8sConfigTemplateName, typOfVfmodule) if (!api.hasConfigTemplate(configTemplate)) { - log.info("K8s Config Template Upload Started") + + + val configTemplateFile: Path = prepareConfigTemplateJson(k8sConfigTemplateName, vfModuleID, label) + + log.info("Config Template Upload Started") api.createConfigTemplate(configTemplate) api.uploadConfigTemplateContent(configTemplate, configTemplateFile) - log.info("K8s Config Template Upload Completed") + log.info("Config Template Upload Completed") } } log.info("DAY-1 Script excution completed") + + } catch (e: Exception) { - log.info("Caught exception trying to get the vnf Details!!") - // throw BluePrintProcessorException("${e.message}") + log.info("Caught exception during config template preparation!!") + throw BluePrintProcessorException("${e.message}") + } + } + private fun getParamValueByName(params: JsonNode, paramName: String): String? { + for (param in params) { + if (param.get("name").asText() == paramName && param.get("value").asText() != "null") { + return param.get("value").asText() + + } } + return null } - fun prepareConfigTemplateJson(configTemplateName: String, typOfVfmodule: String): Path { + fun prepareConfigTemplateJson(configTemplateName: String, vfModuleID: String, label: String?): Path { val bluePrintContext = bluePrintRuntimeService.bluePrintContext() val bluePrintBasePath: String = bluePrintContext.rootPath - var profileFilePath: Path = Paths.get(bluePrintBasePath.plus(File.separator).plus("Templates").plus(File.separator).plus("k8s-profiles").plus(File.separator).plus(typOfVfmodule +"-config-template.tar.gz")) + var profileFilePath: Path = Paths.get(bluePrintBasePath.plus(File.separator).plus("Templates").plus(File.separator).plus("k8s-profiles").plus(File.separator).plus(label +"-config-template.tar.gz")) log.info("Reading K8s Config Template file: $profileFilePath") val profileFile = profileFilePath.toFile() if (!profileFile.exists()) - throw BluePrintProcessorException("K8s Profile template file $profileFilePath does not exists") + throw BluePrintProcessorException("K8s Config template file $profileFilePath does not exists") return profileFilePath } + fun getResolvedParameter(payload: ObjectNode, keyName: String): String { for (node in payload.get("resource-accumulator-resolved-data").elements()) { if (node.get("param-name").asText().equals(keyName)) { @@ -220,167 +228,13 @@ open class DayOneConfig : AbstractScriptComponentFunction() { return "" } override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { - log.info("Executing Recovery") - addError("${runtimeException.message}") + log.info("Recover function called!") + log.info("Execution request : $executionRequest") + log.error("Exception", runtimeException) + addError(runtimeException.message!!) } - fun modifyTemplate(configmapName: String, typOfVfmodule: String): String { - - log.info("Executing modifyTemplate ->") - - val bluePrintContext = bluePrintRuntimeService.bluePrintContext() - val bluePrintBasePath: String = bluePrintContext.rootPath - val destPath: String = "/tmp/config-template-"+typOfVfmodule - - var templateFilePath: Path = Paths.get(bluePrintBasePath.plus(File.separator).plus("Templates").plus(File.separator).plus("k8s-profiles").plus(File.separator).plus(typOfVfmodule +"-config-template.tar.gz")) - - log.info("Reading config template file: ${templateFilePath}") - val templateFile = templateFilePath.toFile() - - if (!templateFile.exists()) - throw BluePrintProcessorException("K8s Profile template file ${templateFilePath} does not exists") - - log.info("Decompressing config template to ${destPath}") - - val decompressedProfile: File = BluePrintArchiveUtils.deCompress(templateFilePath.toFile(), - "${destPath}", ArchiveType.TarGz) - - log.info("${templateFilePath.toString()} decompression completed") - - //Here we update override.yaml file - - val manifestFileName = destPath.plus(File.separator).plus(typOfVfmodule).plus(File.separator).plus("templates").plus(File.separator).plus("configmap.yaml") - log.info("Modification of configmap.yaml file at ${manifestFileName.toString()}") - var finalManifest = "" - File(manifestFileName).bufferedReader().use { inr -> - val manifestYaml = Yaml() - val manifestObject: Map<String, Any> = manifestYaml.load(inr) - - for((k,v) in manifestObject) { - log.info("manifestObject: ${k}, ${v}" ) - } - - log.info("Uploaded YAML object") - - val metadata: MutableMap<String, Any> = manifestObject.get("metadata") as MutableMap<String, Any> - log.info("Uploaded config YAML object") - - for((k,v) in metadata) { - metadata.put(k, configmapName) - } - - finalManifest = manifestYaml.dump(manifestObject) - } - - File(manifestFileName).bufferedWriter().use { out -> out.write(finalManifest) } - - log.info(finalManifest) - - log.info("Reading config template file: ${templateFilePath}") - - if (!templateFile.exists()) - throw BluePrintProcessorException("config template file ${templateFilePath} does not exists") - - val tempMainPath: File = createTempDir("config-template-", "") - val tempConfigTemplatePath: File = createTempDir("conftemplate-", "", tempMainPath) - log.info("Decompressing profile to ${tempConfigTemplatePath.toString()}") - - val decompressedProfile2: File = BluePrintArchiveUtils.deCompress(templateFilePath.toFile(), - "${tempConfigTemplatePath.toString()}", ArchiveType.TarGz) - - log.info("${templateFilePath.toString()} decompression completed") - - //Here we update configmap.yaml file - - log.info("Modification of configmap.yaml file ") - val manifestFileName2 = destPath.toString().plus(File.separator).plus(typOfVfmodule).plus(File.separator).plus("templates").plus(File.separator).plus("configmap.yaml") - val destOverrideFile = tempConfigTemplatePath.toString().plus(File.separator).plus(typOfVfmodule).plus(File.separator).plus("templates").plus(File.separator).plus("configmap.yaml") - log.info("destination override file ${destOverrideFile}") - - File(manifestFileName2).copyTo(File(destOverrideFile), true) - - if (!BluePrintArchiveUtils.compress(decompressedProfile2, templateFilePath.toFile(), - ArchiveType.TarGz)) { - throw BluePrintProcessorException("Profile compression has failed") - } - - log.info("${templateFilePath.toString()} compression completed") - - return "" - } - - inner class K8sInstanceApi( - val username: String, - val password: String, - val baseUrl: String, - val definition: String, - val definitionVersion: String - ) { - private val service: UploadConfigTemplateRestClientService // BasicAuthRestClientService - - init { - var mapOfHeaders = hashMapOf<String, String>() - mapOfHeaders.put("Accept", "application/json") - mapOfHeaders.put("Content-Type", "application/json") - mapOfHeaders.put("cache-control", " no-cache") - mapOfHeaders.put("Accept", "application/json") - var basicAuthRestClientProperties: BasicAuthRestClientProperties = BasicAuthRestClientProperties() - basicAuthRestClientProperties.username = username - basicAuthRestClientProperties.password = password - basicAuthRestClientProperties.url = "$baseUrl/v1/instance" - basicAuthRestClientProperties.additionalHeaders = mapOfHeaders - - this.service = UploadConfigTemplateRestClientService(basicAuthRestClientProperties) - } - - fun getInsnceDetails(instanceId: String, vfModuleType: String): String { - log.info("Executing K8sInstanceApi.getInsnceDetails") - try { - val result: BlueprintWebClientService.WebClientResponse<String> = service.exchangeResource(HttpMethod.GET.name, "/${instanceId}", "") - print(result) - if (result.status >= 200 && result.status < 300) { - log.info("K8s instance details retrieved, processing it for configmap details") - log.info("response body -> "+result.body.toString()) - val cmName: String = processInstanceResponse(result.body, vfModuleType) - return cmName - } else - return "" - } catch (e: Exception) { - log.info("Caught exception trying to get k8s instance details") - throw BluePrintProcessorException("${e.message}") - } - } - - fun processInstanceResponse(response: String, vfModuleType: String): String { - - log.info("K8s instance details retrieved, processing it for configmap details") - - val gson = Gson() - - val startInd = response.indexOf('[') - val endInd = response.indexOf(']') - - val subStr = response.substring(startInd, endInd+1) - - val resourceType = object : TypeToken<Array<K8sResources>>() {}.type - - var resources: Array<K8sResources> = gson.fromJson(subStr, resourceType) - - for (resource in resources){ - - if(resource.GVK?.Kind == "ConfigMap" && resource.Name?.contains(vfModuleType)){ - - return resource.Name - - } - - } - return "" - - } - - } inner class K8sConfigTemplateApi( val username: String, @@ -453,7 +307,7 @@ open class DayOneConfig : AbstractScriptComponentFunction() { } } catch (e: Exception) { log.info("Caught exception trying to create k8s config template ${profile.templateName} - updated") - // throw BluePrintProcessorException("${e.message}") + // throw BluePrintProcessorException("${e.message}") } } @@ -579,6 +433,6 @@ fun main(args: Array<String>) { val kotlin = DayOneConfig() - kotlin.modifyTemplate("modified", "upf") + } diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Scripts/kotlin/KotlinK8sProfileUpload.kt b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Scripts/kotlin/KotlinK8sProfileUpload.kt index 2b8c7b21f..55d73f318 100644 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Scripts/kotlin/KotlinK8sProfileUpload.kt +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Scripts/kotlin/KotlinK8sProfileUpload.kt @@ -1,6 +1,6 @@ /* * Copyright © 2019 Orange - * Author: Malinconico Aniello Paolo <aniellopaolo.malinconico@guest.telecomitalia.it> + * * 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 @@ -65,10 +65,8 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { val prefixList: ArrayList<String> = getTemplatePrefixList(executionRequest) for (prefix in prefixList) { if (prefix.toLowerCase().equals("vnf")) { - log.info("For vnf-level resource-assignment, profile is not performed. Creating override_values") - val assignmentParams = getDynamicProperties("assignment-params") - val payloadObject = JacksonUtils.jsonNode(assignmentParams.get(prefix).asText()) as ObjectNode - createOverrideVaues(payloadObject) + log.info("For vnf-level resource-assignment, profile is not performed.") + continue } val assignmentParams = getDynamicProperties("assignment-params") @@ -77,14 +75,16 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { log.info("Uploading K8S profile for template prefix $prefix") val vfModuleModelInvariantUuid: String = getResolvedParameter(payloadObject, "vf-module-model-invariant-uuid") + val vfModuleId: String = getResolvedParameter(payloadObject, "vf-module-id") val vfModuleModelUuid: String = getResolvedParameter(payloadObject, "vf-module-model-customization-uuid") val k8sRbProfileName: String = getResolvedParameter(payloadObject, "k8s-rb-profile-name") val k8sRbProfileNamespace: String = getResolvedParameter(payloadObject, "k8s-rb-profile-namespace") - val vnfId: String = getResolvedParameter(payloadObject, "vnf-id") - log.info("******vnfID************ $vnfId") + val releaseName:String = getResolvedParameter(payloadObject, "k8s-rb-instance-release-name") + + log.info("******vfModuleID************ $vfModuleId") log.info("k8sRbProfileName $k8sRbProfileName") - // Extract supportedNssai + val api = K8sApi(k8sApiUsername, k8sApiPassword, baseK8sApiUrl, vfModuleModelInvariantUuid, vfModuleModelUuid) if (!api.hasDefinition()) { @@ -101,13 +101,15 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { if (api.hasProfile(k8sRbProfileName)) { log.info("Profile Already Existing - skipping upload") } else { - val profileFilePath: Path = prepareProfileFile(k8sRbProfileName, vnfId) + createOverrideValues(payloadObject, vfModuleId, prefix) + val profileFilePath: Path = prepareProfileFile(k8sRbProfileName, vfModuleId, prefix) var profile = K8sProfile() profile.profileName = k8sRbProfileName profile.rbName = vfModuleModelInvariantUuid profile.rbVersion = vfModuleModelUuid profile.namespace = k8sRbProfileNamespace + profile.releaseName = releaseName api.createProfile(profile) api.uploadProfileContent(profile, profileFilePath) @@ -117,10 +119,10 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { } } - fun prepareProfileFile(k8sRbProfileName: String, vnfId: String): Path { + fun prepareProfileFile(k8sRbProfileName: String, vfModuleId: String, prefix: String): Path { val bluePrintContext = bluePrintRuntimeService.bluePrintContext() val bluePrintBasePath: String = bluePrintContext.rootPath - var profileFilePath: Path = Paths.get(bluePrintBasePath.plus(File.separator).plus("Templates").plus(File.separator).plus("k8s-profiles").plus(File.separator).plus("template-profile.tar.gz")) + var profileFilePath: Path = Paths.get(bluePrintBasePath.plus(File.separator).plus("Templates").plus(File.separator).plus("k8s-profiles").plus(File.separator).plus("$prefix-profile.tar.gz")) log.info("Reading K8s profile file: $profileFilePath") val profileFile = profileFilePath.toFile() @@ -133,22 +135,23 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { log.info("Decompressing profile to $tempProfilePath") val decompressedProfile: File = BluePrintArchiveUtils.deCompress( - profileFilePath.toFile(), - "$tempProfilePath", - ArchiveType.TarGz + profileFilePath.toFile(), + "$tempProfilePath", + ArchiveType.TarGz ) log.info("$profileFilePath decompression completed") - val tempOverrideValuesPath: String = "/tmp/k8s-profile-" + vnfId + val destPath: String = "/tmp/k8s-profile-" + vfModuleId - // Here we are copying the tmp override_values file (created at vnf level) into the profile, before uploading it. This function is performed only at vfmodule level + // Here we update override.yaml file log.info("Modification of override.yaml file ") - val tmpOverrideFile = tempOverrideValuesPath.toString().plus(File.separator).plus("override_values.yaml") + val manifestFileName = destPath.toString().plus(File.separator).plus("override_values.yaml") val destOverrideFile = tempProfilePath.toString().plus(File.separator).plus("override_values.yaml") log.info("destination override file $destOverrideFile") - File(tmpOverrideFile).copyTo(File(destOverrideFile), true) - profileFilePath = Paths.get(tempMainPath.toString().plus(File.separator).plus("template-profile.tar.gz")) + File(manifestFileName).copyTo(File(destOverrideFile), true) + profileFilePath = Paths.get(tempMainPath.toString().plus(File.separator).plus("$prefix-profile.tar.gz")) + if (!BluePrintArchiveUtils.compress(decompressedProfile, profileFilePath.toFile(), ArchiveType.TarGz)) { throw BluePrintProcessorException("Profile compression has failed") @@ -164,7 +167,8 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { return result } - fun createOverrideVaues(payloadObject: ObjectNode): String { + + fun createOverrideValues(payloadObject: ObjectNode, vfModuleId: String, prefix:String): String { // Extract supportedNssai val supportedNssaiMap = LinkedHashMap<String, Any>() val snssai: String = getResolvedParameter(payloadObject, "config.supportedNssai.sNssai.snssai") @@ -173,11 +177,9 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { val bluePrintContext = bluePrintRuntimeService.bluePrintContext() val bluePrintBasePath: String = bluePrintContext.rootPath - val vnfId: String = getResolvedParameter(payloadObject, "vnf-id") - val destPath: String = "/tmp/k8s-profile-" + vnfId - log.info("*********vnfID***** $vnfId") + val destPath: String = "/tmp/k8s-profile-" + vfModuleId - var profileFilePath: Path = Paths.get(bluePrintBasePath.plus(File.separator).plus("Templates").plus(File.separator).plus("k8s-profiles").plus(File.separator).plus("template-profile.tar.gz")) + var profileFilePath: Path = Paths.get(bluePrintBasePath.plus(File.separator).plus("Templates").plus(File.separator).plus("k8s-profiles").plus(File.separator).plus("$prefix-profile.tar.gz")) log.info("Reading K8s profile file: $profileFilePath") val profileFile = profileFilePath.toFile() @@ -188,9 +190,9 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { log.info("Decompressing profile to $destPath") val decompressedProfile: File = BluePrintArchiveUtils.deCompress( - profileFilePath.toFile(), - "$destPath", - ArchiveType.TarGz + profileFilePath.toFile(), + "$destPath", + ArchiveType.TarGz ) log.info("$profileFilePath decompression completed") @@ -245,6 +247,8 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { return "" } + + fun getResolvedParameter(payload: ObjectNode, keyName: String): String { for (node in payload.get("resource-accumulator-resolved-data").elements()) { if (node.get("param-name").asText().equals(keyName)) { @@ -274,16 +278,18 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { } override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { - log.info("Executing Recovery") - addError("${runtimeException.message}") + log.info("Recover function called!") + log.info("Execution request : $executionRequest") + log.error("Exception", runtimeException) + addError(runtimeException.message!!) } inner class K8sApi( - val username: String, - val password: String, - val baseUrl: String, - val definition: String, - val definitionVersion: String + val username: String, + val password: String, + val baseUrl: String, + val definition: String, + val definitionVersion: String ) { private val service: UploadFileRestClientService // BasicAuthRestClientService @@ -319,9 +325,9 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { fun hasProfile(profileName: String): Boolean { try { val result: BlueprintWebClientService.WebClientResponse<String> = service.exchangeResource( - HttpMethod.GET.name, - "/profile/$profileName", - "" + HttpMethod.GET.name, + "/profile/$profileName", + "" ) if (result.status >= 200 && result.status < 300) return true @@ -340,9 +346,9 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { val profileJsonString: String = objectMapper.writeValueAsString(profile) try { val result: BlueprintWebClientService.WebClientResponse<String> = service.exchangeResource( - HttpMethod.POST.name, - "/profile", - profileJsonString + HttpMethod.POST.name, + "/profile", + profileJsonString ) if (result.status < 200 || result.status >= 300) { throw Exception(result.body) @@ -356,8 +362,8 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { fun uploadProfileContent(profile: K8sProfile, filePath: Path) { try { val result: BlueprintWebClientService.WebClientResponse<String> = service.uploadBinaryFile( - "/profile/${profile.profileName}/content", - filePath + "/profile/${profile.profileName}/content", + filePath ) if (result.status < 200 || result.status >= 300) { throw Exception(result.body) @@ -371,20 +377,20 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { } class UploadFileRestClientService( - private val restClientProperties: + private val restClientProperties: BasicAuthRestClientProperties ) : BlueprintWebClientService { override fun defaultHeaders(): Map<String, String> { val encodedCredentials = setBasicAuth( - restClientProperties.username, - restClientProperties.password + restClientProperties.username, + restClientProperties.password ) return mapOf( - HttpHeaders.CONTENT_TYPE to MediaType.APPLICATION_JSON_VALUE, - HttpHeaders.ACCEPT to MediaType.APPLICATION_JSON_VALUE, - HttpHeaders.AUTHORIZATION to "Basic $encodedCredentials" + HttpHeaders.CONTENT_TYPE to MediaType.APPLICATION_JSON_VALUE, + HttpHeaders.ACCEPT to MediaType.APPLICATION_JSON_VALUE, + HttpHeaders.AUTHORIZATION to "Basic $encodedCredentials" ) } @@ -393,26 +399,26 @@ class UploadFileRestClientService( } override fun convertToBasicHeaders(headers: Map<String, String>): - Array<BasicHeader> { - val customHeaders: MutableMap<String, String> = headers.toMutableMap() - // inject additionalHeaders - customHeaders.putAll(verifyAdditionalHeaders(restClientProperties)) + Array<BasicHeader> { + val customHeaders: MutableMap<String, String> = headers.toMutableMap() + // inject additionalHeaders + customHeaders.putAll(verifyAdditionalHeaders(restClientProperties)) - if (!headers.containsKey(HttpHeaders.AUTHORIZATION)) { - val encodedCredentials = setBasicAuth( + if (!headers.containsKey(HttpHeaders.AUTHORIZATION)) { + val encodedCredentials = setBasicAuth( restClientProperties.username, restClientProperties.password - ) - customHeaders[HttpHeaders.AUTHORIZATION] = + ) + customHeaders[HttpHeaders.AUTHORIZATION] = "Basic $encodedCredentials" - } - return super.convertToBasicHeaders(customHeaders) } + return super.convertToBasicHeaders(customHeaders) + } private fun setBasicAuth(username: String, password: String): String { val credentialsString = "$username:$password" return Base64.getEncoder().encodeToString( - credentialsString.toByteArray(Charset.defaultCharset()) + credentialsString.toByteArray(Charset.defaultCharset()) ) } @@ -446,9 +452,11 @@ class K8sProfile { var profileName: String? = null @get:JsonProperty("namespace") var namespace: String? = "default" + @get:JsonProperty("releaseName") + var releaseName: String? = null override fun toString(): String { - return "$rbName:$rbVersion:$profileName" + return "$rbName:$rbVersion:$profileName:$releaseName" } override fun equals(other: Any?): Boolean { diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Scripts/kotlin/KotlinK8sUpdateConfig.kt b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Scripts/kotlin/KotlinK8sUpdateConfig.kt index d10799656..937c00a4f 100644 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Scripts/kotlin/KotlinK8sUpdateConfig.kt +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Scripts/kotlin/KotlinK8sUpdateConfig.kt @@ -1,6 +1,6 @@ /* * Copyright © 2019 TechMahindra -* Author: Vamshi Namilikonda <vn00480215@techmahindra.com> +* * 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 @@ -21,6 +21,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptC import org.slf4j.LoggerFactory import com.fasterxml.jackson.databind.node.ObjectNode import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils +import com.fasterxml.jackson.databind.node.ArrayNode import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import java.nio.file.Path @@ -41,6 +42,14 @@ import java.nio.file.Files import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.RestLoggerService import org.apache.http.client.ClientProtocolException import com.fasterxml.jackson.databind.ObjectMapper +import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.definition.K8sPluginDefinitionApi +import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.K8sConnectionPluginConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.definition.K8sDefinitionRestClient +import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.K8sConfigValueRequest +import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.K8sPluginInstanceApi +import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory +import com.fasterxml.jackson.module.kotlin.convertValue import com.google.gson.Gson import com.google.gson.reflect.TypeToken @@ -60,6 +69,7 @@ open class KotlinK8sUpdateConfig : AbstractScriptComponentFunction() { println("Exeuting processNB") log.info("Executing processNB from Kotlin script: KotlinK8sUpdateConfig ...") + val bluePrintPropertiesService: BluePrintPropertiesService =this.functionDependencyInstanceAsType("bluePrintPropertiesService") // read the config input val baseK8sApiUrl = getDynamicProperties("api-access").get("url").asText() @@ -105,6 +115,8 @@ open class KotlinK8sUpdateConfig : AbstractScriptComponentFunction() { val aaiBody = resultOfGet.body val aaiPayloadObject = JacksonUtils.jsonNode(aaiBody) as ObjectNode + log.info("aaiPayloadObject: $aaiPayloadObject") + for (item in aaiPayloadObject.get("vf-module")) { log.info("item payload Deatils : $item") @@ -126,15 +138,22 @@ open class KotlinK8sUpdateConfig : AbstractScriptComponentFunction() { log.info("AAI Vf-module UUID is : $vfModuleModelUuid") + val vfModuleCustUuid: String = item.get("model-customization-id").asText() + + log.info("AAI Vf-module Customization UUID is : $vfModuleCustUuid") + + val vfModuleInstance: String = item.get("heat-stack-id").asText() log.info("AAI Vf-module Heat Stack ID : $vfModuleInstance") val profileName: String = "profile-"+ vfModuleID - val templateName: String = "template_" + vfModuleID + val templateName: String = "template_" + vfModuleCustUuid + + //val randomString = getRandomString(6) + val configName: String = "config_"+ vfModuleID - val randomString = getRandomString(6) - val configName: String = "config_"+ randomString + log.info("payloadObject: $payloadObject") var supportedNssai: String = getResolvedParameter(payloadObject, "supportedNssai") @@ -144,12 +163,12 @@ open class KotlinK8sUpdateConfig : AbstractScriptComponentFunction() { log.info("templateName ->"+ templateName) - executeK8sAPI(supportedNssai, k8sApiUsername, k8sApiPassword, baseK8sApiUrl, vfModuleModelInvariantUuid, vfModuleModelUuid, templateName, configName, profileName) + executeK8sAPI(bluePrintPropertiesService,supportedNssai, k8sApiUsername, k8sApiPassword, baseK8sApiUrl, vfModuleModelInvariantUuid, vfModuleCustUuid, templateName, configName, profileName, vfModuleInstance) } } catch (e: Exception) { - log.info("Caught exception trying to get the vnf Details!!") + log.info("Caught exception trying to set config values!!") throw BluePrintProcessorException("${e.message}") } } @@ -161,7 +180,7 @@ open class KotlinK8sUpdateConfig : AbstractScriptComponentFunction() { .joinToString("") } - fun executeK8sAPI(supportedNssai: String, k8sApiUsername:String, k8sApiPassword:String, baseK8sApiUrl:String, vfModuleModelInvariantUuid:String, vfModuleModelUuid: String, templateName: String, configName:String, profileName:String){ + fun executeK8sAPI(bluePrintPropertiesService: BluePrintPropertiesService,supportedNssai: String, k8sApiUsername:String, k8sApiPassword:String, baseK8sApiUrl:String, vfModuleModelInvariantUuid:String, vfModuleCustUuid: String, templateName: String, configName:String, profileName:String, instanceId: String){ println("Executing executeK8sAPI ...") @@ -169,7 +188,7 @@ open class KotlinK8sUpdateConfig : AbstractScriptComponentFunction() { val sNssaiAsJsonObj = parseSupportedNssai(supportedNssai) // contruct config api - val api = K8sConfigApi(k8sApiUsername, k8sApiPassword, baseK8sApiUrl, vfModuleModelInvariantUuid, vfModuleModelUuid) + val api = K8sConfigApi(k8sApiUsername, k8sApiPassword, baseK8sApiUrl, vfModuleModelInvariantUuid, vfModuleCustUuid, instanceId, bluePrintPropertiesService) // invoke config api @@ -183,7 +202,7 @@ open class KotlinK8sUpdateConfig : AbstractScriptComponentFunction() { config.values.supportedNssai.snssaiInitial.snssaiSecond.snssaiFinalArray = Array<SnssaiFinal>(sNssaiAsJsonObj.size){i-> SnssaiFinal()} val dest = buildSNssaiArray(config.values.supportedNssai.snssaiInitial.snssaiSecond.snssaiFinalArray, sNssaiAsJsonObj) - api.createOrUpdateConfig(config, profileName) + api.createOrUpdateConfig(config, profileName, instanceId, configName, templateName) log.info("K8s Configurations create or update Completed") @@ -231,8 +250,18 @@ open class KotlinK8sUpdateConfig : AbstractScriptComponentFunction() { return "" } + fun getTemplatePrefixList(executionRequest: ExecutionServiceInput): ArrayList<String> { + val result = ArrayList<String>() + for (prefix in executionRequest.payload.get("resource-assignment-request").get("template-prefix").elements()) + result.add(prefix.asText()) + return result + } + override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { - log.info("Executing Recovery") + log.info("Recover function called!") + log.info("Execution request : $executionRequest") + log.error("Exception", runtimeException) + addError(runtimeException.message!!) } inner class K8sConfigApi( @@ -240,7 +269,10 @@ open class KotlinK8sUpdateConfig : AbstractScriptComponentFunction() { val password: String, val baseUrl: String, val definition: String, - val definitionVersion: String + val definitionVersion: String, + val instanceId: String, + val bluePrintPropertiesService: BluePrintPropertiesService + ) { private val service: UploadFileConfigClientService // BasicAuthRestClientService @@ -253,14 +285,16 @@ open class KotlinK8sUpdateConfig : AbstractScriptComponentFunction() { var basicAuthRestClientProperties: BasicAuthRestClientProperties = BasicAuthRestClientProperties() basicAuthRestClientProperties.username = username basicAuthRestClientProperties.password = password - basicAuthRestClientProperties.url = "$baseUrl/v1/rb/definition/$definition/$definitionVersion" + basicAuthRestClientProperties.url = "$baseUrl/v1/instance" basicAuthRestClientProperties.additionalHeaders = mapOfHeaders this.service = UploadFileConfigClientService(basicAuthRestClientProperties) } - fun createOrUpdateConfig(configJson: K8sConfigPayloadJson, profileName: String) { + fun createOrUpdateConfig(configJson: K8sConfigPayloadJson, profileName: String, instanceId: String, configName: String, templateName: String) { val objectMapper = ObjectMapper() + var obj: Any? = null + val yamlReader = ObjectMapper(YAMLFactory()) for(snssai in configJson.values.supportedNssai.snssaiInitial.snssaiSecond.snssaiFinalArray){ println("snssai->" +snssai.snssai) @@ -268,7 +302,7 @@ open class KotlinK8sUpdateConfig : AbstractScriptComponentFunction() { } - val configJsonString: String = objectMapper.writeValueAsString(configJson) + val configJsonString: String = objectMapper.writeValueAsString(configJson.values) log.info("payload generated -> "+ configJsonString) @@ -280,16 +314,20 @@ open class KotlinK8sUpdateConfig : AbstractScriptComponentFunction() { val finalPayload: String = configJsonString.replaceRange(startInd..endInd, snssaiArray) log.info("payload restructured -> "+ finalPayload) + obj = yamlReader.readValue(finalPayload, Any::class.java) + - try { - val result: BlueprintWebClientService.WebClientResponse<String> = service.exchangeResource(HttpMethod.POST.name, - "/profile/${profileName}/config", finalPayload) - if (result.status < 200 || result.status >= 300) { - throw Exception(result.body) - } - } catch (e: Exception) { - log.info("Caught exception trying to create or update configuration ") - throw BluePrintProcessorException("${e.message}") + + val api = K8sPluginInstanceApi(K8sConnectionPluginConfiguration(bluePrintPropertiesService)) + + val configValueRequest = K8sConfigValueRequest() + configValueRequest.templateName = configJson.templateName + configValueRequest.configName = configJson.configName + configValueRequest.values = objectMapper.convertValue(obj) + if (api.hasConfigurationValues(instanceId, configName)) { + api.editConfigurationValues(configValueRequest, instanceId, configName) + } else { + api.createConfigurationValues(configValueRequest, instanceId) } } @@ -429,16 +467,6 @@ fun main(args: Array<String>) { val kotlin = KotlinK8sUpdateConfig() - /* supportedNssai - k8sApiUsername - k8sApiPassword - baseK8sApiUrl - vfModuleModelInvariantUuid - vfModuleModelUuid - templateName - configName - profileName*/ - - kotlin.executeK8sAPI(supportedNssai, "admin", "admin", "http://0.0.0.0:9015", "rb_test", "1", "template_test", "config_test", "profile_test") + } diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/amf-mapping.json b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/amf-mapping.json deleted file mode 100644 index 069d58d3f..000000000 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/amf-mapping.json +++ /dev/null @@ -1,261 +0,0 @@ -[ - { - "name": "vf-module-model-invariant-uuid", - "property": { - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-model-invariant-uuid", - "dictionary-source": "processor-db", - "dependencies": [ - "vf-module-model-customization-uuid" - ] - }, - { - "name": "vf-module-model-version", - "property": { - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-model-version", - "dictionary-source": "processor-db", - "dependencies": [ - "vf-module-model-customization-uuid" - ] - }, - { - "name": "management-prefix-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "management-prefix-id", - "dictionary-source": "processor-db", - "dependencies": [], - "version": 0 - }, - { - "name": "service-instance-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "service-instance-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vf-module-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vf-module-label", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-label", - "dictionary-source": "processor-db", - "dependencies": [ - "vf-module-model-customization-uuid" - ], - "version": 0 - }, - { - "name": "vf-module-model-customization-uuid", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-model-customization-uuid", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vf-naming-policy", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-naming-policy", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ], - "version": 0 - }, - { - "name": "vnf-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vnf-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vnf_name", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vnf_name", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ], - "version": 0 - }, - { - "name": "k8s-rb-profile-namespace", - "property": { - "description": "K8s namespace to create helm chart for specified profile", - "type": "string" - }, - "input-param": false, - "dictionary-name": "k8s-rb-profile-namespace", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "k8s-rb-profile-name", - "property": { - "description": "Profile name used in multicloud/k8s plugin to identify Helm chart(s) where this mapping is providing override values.", - "type": "string" - }, - "input-param": false, - "dictionary-name": "k8s-rb-profile-name", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "fiveg0_snssai", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "fiveg0_snssai", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "snssai", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "snssai", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.test", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "config.test", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.singletest", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "singletest", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.amfName", - "property": { - "description": "amf name", - "type": "string" - }, - "input-param": false, - "dictionary-name": "config.amfName", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "amfName", - "property": { - "description": "amf name", - "type": "string" - }, - "input-param": false, - "dictionary-name": "amfName", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.supportedNssai.sNssai.snssai", - "property": { - "description": "supportedNssai.sNssai.snssai properties", - "type": "string" - }, - "input-param": false, - "dictionary-name": "config.supportedNssai.sNssai.snssai", - "dictionary-source": "sdnc", - "dependencies": [] - } -] diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/amf-template.vtl b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/amf-template.vtl deleted file mode 100644 index b2abaae51..000000000 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/amf-template.vtl +++ /dev/null @@ -1,136 +0,0 @@ -{ - "capability-data": [ - { - "capability-name": "generate-name", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "vf_module_name", - "resource-value": "${vf-module-name}" - } - ], - "payload": [ - { - "param-name": "VF_MODULE_TYPE", - "param-value": "vfmt" - }, - { - "param-name": "resource-name", - "param-value": "vf_module_name" - }, - { - "param-name": "resource-value", - "param-value": "${vf-module-name}" - }, - { - "param-name": "external-key", - "param-value": "${vf-module-id}_vf-module-name" - }, - { - "param-name": "policy-instance-name", - "param-value": "${vf-naming-policy}" - }, - { - "param-name": "naming-type", - "param-value": "VF-MODULE" - }, - { - "param-name": "VNF_NAME", - "param-value": "${vnf_name}" - }, - { - "param-name": "VF_MODULE_LABEL", - "param-value": "${vf-module-label}" - } - ] - } - ] - }, - { - "capability-name": "aai-vf-module-put", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "aai-vf-module-put", - "resource-value": "" - } - ] - } - ] - }, - { - "capability-name": "unresolved-composite-data", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "config.amfName", - "resource-value": "${vf_module_name}" - } - ] - } - ] - }, - { - "capability-name": "unresolved-composite-data", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "amfName", - "resource-value": "${vf_module_name}" - } - ] - } - ] - } - ], - "resource-accumulator-resolved-data": [ - { - "param-name": "vf-module-model-invariant-uuid", - "param-value": "${vf-module-model-invariant-uuid}" - }, - { - "param-name": "vf-module-model-customization-uuid", - "param-value": "${vf-module-model-customization-uuid}" - }, - { - "param-name": "vnf-id", - "param-value": "${vnf-id}" - }, - { - "param-name": "config.test", - "param-value": "${config.test}" - }, - { - "param-name": "vf-module-id", - "param-value": "${vf-module-id}" - }, - { - "param-name": "k8s-rb-profile-name", - "param-value": "profile-${vf-module-id}" - }, - { - "param-name": "k8s-rb-profile-namespace", - "param-value": "ns-${vf-module-id}" - }, - { - "param-name": "fiveg0_snssai", - "param-value": "${fiveg0_snssai}" - }, - { - "param-name": "snssai", - "param-value": "${fiveg0_snssai}" - }, - { - "param-name": "config.supportedNssai.sNssai.snssai", - "param-value": "${fiveg0_snssai}" - }, - { - "param-name": "config.singletest", - "param-value": "${singletest}" - } - ] -} diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/base_template-mapping.json b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/base_template-mapping.json deleted file mode 100644 index cceb4fe3a..000000000 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/base_template-mapping.json +++ /dev/null @@ -1,166 +0,0 @@ -[ - { - "name": "vf-module-model-invariant-uuid", - "property": { - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-model-invariant-uuid", - "dictionary-source": "processor-db", - "dependencies": [ - "vf-module-model-customization-uuid" - ] - }, - { - "name": "vf-module-model-version", - "property": { - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-model-version", - "dictionary-source": "processor-db", - "dependencies": [ - "vf-module-model-customization-uuid" - ] - }, - { - "name": "management-prefix-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "management-prefix-id", - "dictionary-source": "processor-db", - "dependencies": [], - "version": 0 - }, - { - "name": "vnf_name", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vnf_name", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ], - "version": 0 - }, - { - "name": "service-instance-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "service-instance-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vf-module-label", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-label", - "dictionary-source": "processor-db", - "dependencies": [ - "vf-module-model-customization-uuid" - ], - "version": 0 - }, - { - "name": "vf-naming-policy", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-naming-policy", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ], - "version": 0 - }, - { - "name": "vf-module-model-customization-uuid", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-model-customization-uuid", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vnf-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vnf-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vf-module-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "k8s-rb-profile-namespace", - "property": { - "description": "K8s namespace to create helm chart for specified profile", - "type": "string" - }, - "input-param": false, - "dictionary-name": "k8s-rb-profile-namespace", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "k8s-rb-profile-name", - "property": { - "description": "Profile name used in multicloud/k8s plugin to identify Helm chart(s) where this mapping is providing override values.", - "type": "string" - }, - "input-param": false, - "dictionary-name": "k8s-rb-profile-name", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - } -] diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/base_template-template.vtl b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/base_template-template.vtl deleted file mode 100644 index fcee84620..000000000 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/base_template-template.vtl +++ /dev/null @@ -1,90 +0,0 @@ -{ - "capability-data": [ - { - "capability-name": "generate-name", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "vf_module_name", - "resource-value": "${vf-module-name}" - } - ], - "payload": [ - { - "param-name": "resource-name", - "param-value": "vf_module_name" - }, - { - "param-name": "resource-value", - "param-value": "${vf-module-name}" - }, - { - "param-name": "external-key", - "param-value": "${vf-module-id}_vf-module-name" - }, - { - "param-name": "policy-instance-name", - "param-value": "${vf-naming-policy}" - }, - { - "param-name": "naming-type", - "param-value": "VF-MODULE" - }, - { - "param-name": "VNF_NAME", - "param-value": "${vnf_name}" - }, - { - "param-name": "VF_MODULE_TYPE", - "param-value": "vfmt" - }, - { - "param-name": "VF_MODULE_LABEL", - "param-value": "${vf-module-label}" - } - ] - } - ] - }, - { - "capability-name": "aai-vf-module-put", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "aai-vf-module-put", - "resource-value": "" - } - ] - } - ] - } - ], - "resource-accumulator-resolved-data": [ - { - "param-name": "vf-module-model-invariant-uuid", - "param-value": "${vf-module-model-invariant-uuid}" - }, - { - "param-name": "vf-module-model-customization-uuid", - "param-value": "${vf-module-model-customization-uuid}" - }, - { - "param-name": "vf-module-id", - "param-value": "${vf-module-id}" - }, - { - "param-name": "k8s-rb-profile-name", - "param-value": "profile-${vf-module-id}" - }, - { - "param-name": "k8s-rb-profile-namespace", - "param-value": "ns-${vf-module-id}" - }, - { - "param-name": "vnf-id", - "param-value": "${vnf-id}" - } - ] -} diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfig-mapping.json b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfig-mapping.json index e5cc9b6a3..9bfa103aa 100644 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfig-mapping.json +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfig-mapping.json @@ -1,42 +1,42 @@ -[ - { - "name": "service-instance-id", - "property": { - "description": "", - "required": false, - "type": "string", - "status": "", - "constraints": [ - {} - ], - "entry_schema": { - "type": "" - } - }, - "input-param": false, - "dictionary-name": "service-instance-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vnf-id", - "property": { - "description": "", - "required": false, - "type": "string", - "status": "", - "constraints": [ - {} - ], - "entry_schema": { - "type": "" - } - }, - "input-param": false, - "dictionary-name": "vnf-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - } -] +[
+ {
+ "name": "service-instance-id",
+ "property": {
+ "description": "",
+ "required": false,
+ "type": "string",
+ "status": "",
+ "constraints": [
+ {}
+ ],
+ "entry_schema": {
+ "type": ""
+ }
+ },
+ "input-param": false,
+ "dictionary-name": "service-instance-id",
+ "dictionary-source": "input",
+ "dependencies": [],
+ "version": 0
+ },
+ {
+ "name": "vnf-id",
+ "property": {
+ "description": "",
+ "required": false,
+ "type": "string",
+ "status": "",
+ "constraints": [
+ {}
+ ],
+ "entry_schema": {
+ "type": ""
+ }
+ },
+ "input-param": false,
+ "dictionary-name": "vnf-id",
+ "dictionary-source": "input",
+ "dependencies": [],
+ "version": 0
+ }
+]
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfig-template.vtl b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfig-template.vtl index b45b814e9..822626c3d 100644 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfig-template.vtl +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfig-template.vtl @@ -1,12 +1,12 @@ -{ - "resource-accumulator-resolved-data": [ - { - "param-name": "service-instance-id", - "param-value": "${service-instance-id}" - }, - { - "param-name": "vnf-id", - "param-value": "${vnf-id}" - } - ] -} +{
+ "resource-accumulator-resolved-data": [
+ {
+ "param-name": "service-instance-id",
+ "param-value": "${service-instance-id}"
+ },
+ {
+ "param-name": "vnf-id",
+ "param-value": "${vnf-id}"
+ }
+ ]
+}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfigput-mapping.json b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfigput-mapping.json index 104f6e989..a3b4e3586 100644 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfigput-mapping.json +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfigput-mapping.json @@ -1,56 +1,56 @@ -[ - { - "name": "service-instance-id", - "property": { - "description": "", - "required": false, - "type": "string", - "status": "", - "constraints": [ - {} - ], - "entry_schema": { - "type": "" - } - }, - "input-param": false, - "dictionary-name": "service-instance-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vnf-id", - "property": { - "description": "", - "required": false, - "type": "string", - "status": "", - "constraints": [ - {} - ], - "entry_schema": { - "type": "" - } - }, - "input-param": false, - "dictionary-name": "vnf-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "supportedNssai", - "property": { - "description": "", - "required": false, - "type": "string", - "default": "hello" - }, - "input-param": false, - "dictionary-name": "supportedNssai", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - } -] +[
+ {
+ "name": "service-instance-id",
+ "property": {
+ "description": "",
+ "required": false,
+ "type": "string",
+ "status": "",
+ "constraints": [
+ {}
+ ],
+ "entry_schema": {
+ "type": ""
+ }
+ },
+ "input-param": false,
+ "dictionary-name": "service-instance-id",
+ "dictionary-source": "input",
+ "dependencies": [],
+ "version": 0
+ },
+ {
+ "name": "vnf-id",
+ "property": {
+ "description": "",
+ "required": false,
+ "type": "string",
+ "status": "",
+ "constraints": [
+ {}
+ ],
+ "entry_schema": {
+ "type": ""
+ }
+ },
+ "input-param": false,
+ "dictionary-name": "vnf-id",
+ "dictionary-source": "input",
+ "dependencies": [],
+ "version": 0
+ },
+ {
+ "name": "supportedNssai",
+ "property": {
+ "description": "",
+ "required": false,
+ "type": "string",
+ "default": "hello"
+ },
+ "input-param": false,
+ "dictionary-name": "supportedNssai",
+ "dictionary-source": "input",
+ "dependencies": [],
+ "version": 0
+ }
+]
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfigput-template.vtl b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfigput-template.vtl index 1967a20bd..afda3c735 100644 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfigput-template.vtl +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/baseconfigput-template.vtl @@ -1,16 +1,16 @@ -{ - "resource-accumulator-resolved-data": [ - { - "param-name": "service-instance-id", - "param-value": "${service-instance-id}" - }, - { - "param-name": "vnf-id", - "param-value": "${vnf-id}" - }, - { - "param-name": "supportedNssai", - "param-value": "${supportedNssai}" - } - ] -} +{
+ "resource-accumulator-resolved-data": [
+ {
+ "param-name": "service-instance-id",
+ "param-value": "${service-instance-id}"
+ },
+ {
+ "param-name": "vnf-id",
+ "param-value": "${vnf-id}"
+ },
+ {
+ "param-name": "supportedNssai",
+ "param-value": "${supportedNssai}"
+ }
+ ]
+}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/config-deploy-aai-mapping.json b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/config-deploy-aai-mapping.json new file mode 100644 index 000000000..9dc90f2f5 --- /dev/null +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/config-deploy-aai-mapping.json @@ -0,0 +1,63 @@ +[
+ {
+ "name": "service-instance-id",
+ "property": {
+ "description": "",
+ "required": false,
+ "type": "string",
+ "status": "",
+ "constraints": [
+ {}
+ ],
+ "entry_schema": {
+ "type": ""
+ }
+ },
+ "input-param": false,
+ "dictionary-name": "service-instance-id",
+ "dictionary-source": "input",
+ "dependencies": [],
+ "version": 0
+ },
+ {
+ "name": "vnf-id",
+ "property": {
+ "description": "",
+ "required": false,
+ "type": "string"
+ },
+ "input-param": false,
+ "dictionary-name": "vnf-id",
+ "dictionary-source": "input",
+ "dependencies": [],
+ "version": 0
+ },
+ {
+ "name": "vf-modules-list-sdnc",
+ "property": {
+ "description": "list of modules associated with vnf from MDSAL",
+ "type": "json"
+ },
+ "input-param": false,
+ "dictionary-name": "vf-modules-list",
+ "dictionary-source": "sdnc",
+ "dependencies": [
+ "service-instance-id",
+ "vnf-id"
+ ]
+ },
+ {
+ "name": "vf-modules-list-aai",
+ "property": {
+ "description": "list of modules associated with vnf from AAI",
+ "type": "json"
+ },
+ "input-param": false,
+ "dictionary-name": "vf-modules-list",
+ "dictionary-source": "aai-data",
+ "dependencies": [
+ "service-instance-id",
+ "vnf-id"
+ ]
+ }
+]
diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/config-deploy-aai-template.vtl b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/config-deploy-aai-template.vtl new file mode 100644 index 000000000..9d4e340f3 --- /dev/null +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/config-deploy-aai-template.vtl @@ -0,0 +1 @@ +${vf-modules-list-aai}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/config-deploy-sdnc-mapping.json b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/config-deploy-sdnc-mapping.json new file mode 100644 index 000000000..9dc90f2f5 --- /dev/null +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/config-deploy-sdnc-mapping.json @@ -0,0 +1,63 @@ +[
+ {
+ "name": "service-instance-id",
+ "property": {
+ "description": "",
+ "required": false,
+ "type": "string",
+ "status": "",
+ "constraints": [
+ {}
+ ],
+ "entry_schema": {
+ "type": ""
+ }
+ },
+ "input-param": false,
+ "dictionary-name": "service-instance-id",
+ "dictionary-source": "input",
+ "dependencies": [],
+ "version": 0
+ },
+ {
+ "name": "vnf-id",
+ "property": {
+ "description": "",
+ "required": false,
+ "type": "string"
+ },
+ "input-param": false,
+ "dictionary-name": "vnf-id",
+ "dictionary-source": "input",
+ "dependencies": [],
+ "version": 0
+ },
+ {
+ "name": "vf-modules-list-sdnc",
+ "property": {
+ "description": "list of modules associated with vnf from MDSAL",
+ "type": "json"
+ },
+ "input-param": false,
+ "dictionary-name": "vf-modules-list",
+ "dictionary-source": "sdnc",
+ "dependencies": [
+ "service-instance-id",
+ "vnf-id"
+ ]
+ },
+ {
+ "name": "vf-modules-list-aai",
+ "property": {
+ "description": "list of modules associated with vnf from AAI",
+ "type": "json"
+ },
+ "input-param": false,
+ "dictionary-name": "vf-modules-list",
+ "dictionary-source": "aai-data",
+ "dependencies": [
+ "service-instance-id",
+ "vnf-id"
+ ]
+ }
+]
diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/config-deploy-sdnc-template.vtl b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/config-deploy-sdnc-template.vtl new file mode 100644 index 000000000..ae6efa758 --- /dev/null +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/config-deploy-sdnc-template.vtl @@ -0,0 +1 @@ +${vf-modules-list-sdnc}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_amf-mapping.json b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_amf-mapping.json new file mode 100644 index 000000000..aee7200cf --- /dev/null +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_amf-mapping.json @@ -0,0 +1,152 @@ +[ + { + "name": "vf-module-model-invariant-uuid", + "property": { + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-model-invariant-uuid", + "dictionary-source": "processor-db", + "dependencies": [ + "vf-module-model-customization-uuid" + ] + }, + { + "name": "fivegc0_snssai", + "property": { + "description": "", + "type": "string" + }, + "input-param": false, + "dictionary-name": "fivegc0_snssai", + "dictionary-source": "sdnc", + "dependencies": [ + "service-instance-id", + "vnf-id" + ] + }, + { + "name": "vf-module-model-version", + "property": { + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-model-version", + "dictionary-source": "processor-db", + "dependencies": [ + "vf-module-model-customization-uuid" + ] + }, + { + "name": "management-prefix-id", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "management-prefix-id", + "dictionary-source": "processor-db", + "dependencies": [], + "version": 0 + }, + { + "name": "service-instance-id", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "service-instance-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vf-module-id", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vf-module-label", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-label", + "dictionary-source": "processor-db", + "dependencies": [ + "vf-module-model-customization-uuid" + ], + "version": 0 + }, + { + "name": "vf-module-model-customization-uuid", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-model-customization-uuid", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vf-naming-policy", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-naming-policy", + "dictionary-source": "sdnc", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + }, + { + "name": "vnf-id", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vnf-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vnf_name", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vnf_name", + "dictionary-source": "sdnc", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + } +] diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_amf-template.vtl b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_amf-template.vtl new file mode 100644 index 000000000..6cc18ff1a --- /dev/null +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_amf-template.vtl @@ -0,0 +1,138 @@ +{ + "capability-data": [ + { + "capability-name": "generate-name", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "vf_module_name", + "resource-value": "${vf-module-name}" + } + ], + "payload": [ + { + "param-name": "VF_MODULE_TYPE", + "param-value": "vfmt" + }, + { + "param-name": "resource-name", + "param-value": "vf_module_name" + }, + { + "param-name": "resource-value", + "param-value": "${vf-module-name}" + }, + { + "param-name": "external-key", + "param-value": "${vf-module-id}_vf-module-name" + }, + { + "param-name": "policy-instance-name", + "param-value": "${vf-naming-policy}" + }, + { + "param-name": "naming-type", + "param-value": "VF-MODULE" + }, + { + "param-name": "VNF_NAME", + "param-value": "${vnf_name}" + }, + { + "param-name": "VF_MODULE_LABEL", + "param-value": "${vf-module-label}" + } + ] + } + ] + }, + { + "capability-name": "aai-vf-module-put", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "aai-vf-module-put", + "resource-value": "" + } + ] + } + ] + }, + { + "capability-name": "unresolved-composite-data", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "config.amfName", + "resource-value": "amf" + } + ] + } + ] + }, + { + "capability-name": "unresolved-composite-data", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "amfName", + "resource-value": "amf" + } + ] + } + ] + } + ], + "resource-accumulator-resolved-data": [ + { + "param-name": "vf-module-model-invariant-uuid", + "param-value": "${vf-module-model-invariant-uuid}" + }, + { + "param-name": "vf-module-label", + "param-value": "${vf-module-label}" + }, + { + "param-name": "vf-module-model-version", + "param-value": "${vf-module-model-version}" + }, + { + "param-name": "vnf-id", + "param-value": "${vnf-id}" + }, + { + "param-name": "vf-module-id", + "param-value": "${vf-module-id}" + }, + { + "param-name": "k8s-rb-profile-name", + "param-value": "profile-${vf-module-id}" + }, + { + "param-name": "k8s-rb-profile-namespace", + "param-value": "ns-${vf-module-id}" + }, + { + "param-name": "k8s-rb-instance-release-name", + "param-value": "release-${vf-module-id}" + }, + { + "param-name": "vf-module-model-customization-uuid", + "param-value": "${vf-module-model-customization-uuid}" + }, + { + "param-name": "fivegc0_snssai", + "param-value": "${fivegc0_snssai}" + }, + { + "param-name": "config.supportedNssai.sNssai.snssai", + "param-value": "${fivegc0_snssai}" + } + + + ] +} diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_smf-mapping.json b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_smf-mapping.json new file mode 100644 index 000000000..c8b82ea20 --- /dev/null +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_smf-mapping.json @@ -0,0 +1,153 @@ +[ + { + "name": "vf-module-model-invariant-uuid", + "property": { + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-model-invariant-uuid", + "dictionary-source": "processor-db", + "dependencies": [ + "vf-module-model-customization-uuid" + ] + }, + { + "name": "fivegc0_snssai", + "property": { + "description": "", + "type": "string" + }, + "input-param": false, + "dictionary-name": "fivegc0_snssai", + "dictionary-source": "sdnc", + "dependencies": [ + "service-instance-id", + "vnf-id" + ] + }, + + { + "name": "vf-module-model-version", + "property": { + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-model-version", + "dictionary-source": "processor-db", + "dependencies": [ + "vf-module-model-customization-uuid" + ] + }, + { + "name": "management-prefix-id", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "management-prefix-id", + "dictionary-source": "processor-db", + "dependencies": [], + "version": 0 + }, + { + "name": "service-instance-id", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "service-instance-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vf-module-id", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vf-module-label", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-label", + "dictionary-source": "processor-db", + "dependencies": [ + "vf-module-model-customization-uuid" + ], + "version": 0 + }, + { + "name": "vf-module-model-customization-uuid", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-model-customization-uuid", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vf-naming-policy", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-naming-policy", + "dictionary-source": "sdnc", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + }, + { + "name": "vnf-id", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vnf-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vnf_name", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vnf_name", + "dictionary-source": "sdnc", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + } +] diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_smf-template.vtl b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_smf-template.vtl new file mode 100644 index 000000000..ba834e8e5 --- /dev/null +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_smf-template.vtl @@ -0,0 +1,138 @@ +{ + "capability-data": [ + { + "capability-name": "generate-name", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "vf_module_name", + "resource-value": "${vf-module-name}" + } + ], + "payload": [ + { + "param-name": "VF_MODULE_TYPE", + "param-value": "vfmt" + }, + { + "param-name": "resource-name", + "param-value": "vf_module_name" + }, + { + "param-name": "resource-value", + "param-value": "${vf-module-name}" + }, + { + "param-name": "external-key", + "param-value": "${vf-module-id}_vf-module-name" + }, + { + "param-name": "policy-instance-name", + "param-value": "${vf-naming-policy}" + }, + { + "param-name": "naming-type", + "param-value": "VF-MODULE" + }, + { + "param-name": "VNF_NAME", + "param-value": "${vnf_name}" + }, + { + "param-name": "VF_MODULE_LABEL", + "param-value": "${vf-module-label}" + } + ] + } + ] + }, + { + "capability-name": "aai-vf-module-put", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "aai-vf-module-put", + "resource-value": "" + } + ] + } + ] + }, + { + "capability-name": "unresolved-composite-data", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "config.smfName", + "resource-value": "smf" + } + ] + } + ] + }, + { + "capability-name": "unresolved-composite-data", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "smfName", + "resource-value": "smf" + } + ] + } + ] + } + ], + "resource-accumulator-resolved-data": [ + { + "param-name": "vf-module-model-invariant-uuid", + "param-value": "${vf-module-model-invariant-uuid}" + }, + { + "param-name": "vf-module-model-version", + "param-value": "${vf-module-model-version}" + }, + { + "param-name": "vnf-id", + "param-value": "${vnf-id}" + }, + { + "param-name": "vf-module-id", + "param-value": "${vf-module-id}" + }, + { + "param-name": "vf-module-label", + "param-value": "${vf-module-label}" + }, + + { + "param-name": "k8s-rb-profile-name", + "param-value": "profile-${vf-module-id}" + }, + { + "param-name": "k8s-rb-instance-release-name", + "param-value": "release-${vf-module-id}" + }, + { + "param-name": "vf-module-model-customization-uuid", + "param-value": "${vf-module-model-customization-uuid}" + }, + { + "param-name": "k8s-rb-profile-namespace", + "param-value": "ns-${vf-module-id}" + }, + + { + "param-name": "fivegc0_snssai", + "param-value": "${fivegc0_snssai}" + }, + { + "param-name": "config.supportedNssai.sNssai.snssai", + "param-value": "${fivegc0_snssai}" + } + ] +} diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_upf-mapping.json b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_upf-mapping.json new file mode 100644 index 000000000..c8b82ea20 --- /dev/null +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_upf-mapping.json @@ -0,0 +1,153 @@ +[ + { + "name": "vf-module-model-invariant-uuid", + "property": { + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-model-invariant-uuid", + "dictionary-source": "processor-db", + "dependencies": [ + "vf-module-model-customization-uuid" + ] + }, + { + "name": "fivegc0_snssai", + "property": { + "description": "", + "type": "string" + }, + "input-param": false, + "dictionary-name": "fivegc0_snssai", + "dictionary-source": "sdnc", + "dependencies": [ + "service-instance-id", + "vnf-id" + ] + }, + + { + "name": "vf-module-model-version", + "property": { + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-model-version", + "dictionary-source": "processor-db", + "dependencies": [ + "vf-module-model-customization-uuid" + ] + }, + { + "name": "management-prefix-id", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "management-prefix-id", + "dictionary-source": "processor-db", + "dependencies": [], + "version": 0 + }, + { + "name": "service-instance-id", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "service-instance-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vf-module-id", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vf-module-label", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-label", + "dictionary-source": "processor-db", + "dependencies": [ + "vf-module-model-customization-uuid" + ], + "version": 0 + }, + { + "name": "vf-module-model-customization-uuid", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-model-customization-uuid", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vf-naming-policy", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-naming-policy", + "dictionary-source": "sdnc", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + }, + { + "name": "vnf-id", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vnf-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vnf_name", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vnf_name", + "dictionary-source": "sdnc", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + } +] diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_upf-template.vtl b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_upf-template.vtl new file mode 100644 index 000000000..a62807ac9 --- /dev/null +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/helm_upf-template.vtl @@ -0,0 +1,141 @@ +{ + "capability-data": [ + { + "capability-name": "generate-name", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "vf_module_name", + "resource-value": "${vf-module-name}" + } + ], + "payload": [ + { + "param-name": "VF_MODULE_TYPE", + "param-value": "vfmt" + }, + { + "param-name": "resource-name", + "param-value": "vf_module_name" + }, + { + "param-name": "resource-value", + "param-value": "${vf-module-name}" + }, + + { + "param-name": "external-key", + "param-value": "${vf-module-id}_vf-module-name" + }, + { + "param-name": "policy-instance-name", + "param-value": "${vf-naming-policy}" + }, + { + "param-name": "naming-type", + "param-value": "VF-MODULE" + }, + { + "param-name": "VNF_NAME", + "param-value": "${vnf_name}" + }, + { + "param-name": "VF_MODULE_LABEL", + "param-value": "${vf-module-label}" + } + ] + } + ] + }, + { + "capability-name": "aai-vf-module-put", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "aai-vf-module-put", + "resource-value": "" + } + ] + } + ] + }, + { + "capability-name": "unresolved-composite-data", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "config.upfName", + "resource-value": "upf" + } + ] + } + ] + }, + { + "capability-name": "unresolved-composite-data", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "upfName", + "resource-value": "upf" + } + ] + } + ] + } + ], + "resource-accumulator-resolved-data": [ + { + "param-name": "vf-module-model-invariant-uuid", + "param-value": "${vf-module-model-invariant-uuid}" + }, + { + "param-name": "vf-module-model-version", + "param-value": "${vf-module-model-version}" + }, + { + "param-name": "vnf-id", + "param-value": "${vnf-id}" + }, + { + "param-name": "vf-module-label", + "param-value": "${vf-module-label}" + }, + + + { + "param-name": "vf-module-id", + "param-value": "${vf-module-id}" + }, + { + "param-name": "k8s-rb-profile-name", + "param-value": "profile-${vf-module-id}" + }, + { + "param-name": "k8s-rb-profile-namespace", + "param-value": "ns-${vf-module-id}" + }, + { + "param-name": "k8s-rb-instance-release-name", + "param-value": "release-${vf-module-id}" + }, + + { + "param-name": "vf-module-model-customization-uuid", + "param-value": "${vf-module-model-customization-uuid}" + }, + { + "param-name": "fivegc0_snssai", + "param-value": "${fivegc0_snssai}" + }, + { + "param-name": "config.supportedNssai.sNssai.snssai", + "param-value": "${fivegc0_snssai}" + } + + ] +} diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/amf-config-template.tar.gz b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/helm_amf-config-template.tar.gz Binary files differindex 439c26e93..439c26e93 100644 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/amf-config-template.tar.gz +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/helm_amf-config-template.tar.gz diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/template-profile.tar.gz b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/helm_amf-profile.tar.gz Binary files differindex fbdcfb64c..fbdcfb64c 100644 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/template-profile.tar.gz +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/helm_amf-profile.tar.gz diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/smf-config-template.tar.gz b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/helm_smf-config-template.tar.gz Binary files differindex 49fe8c323..49fe8c323 100644 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/smf-config-template.tar.gz +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/helm_smf-config-template.tar.gz diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/helm_smf-profile.tar.gz b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/helm_smf-profile.tar.gz Binary files differnew file mode 100644 index 000000000..fbdcfb64c --- /dev/null +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/helm_smf-profile.tar.gz diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/upf-config-template.tar.gz b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/helm_upf-config-template.tar.gz Binary files differindex ba799ab8f..ba799ab8f 100644 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/upf-config-template.tar.gz +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/helm_upf-config-template.tar.gz diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/helm_upf-profile.tar.gz b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/helm_upf-profile.tar.gz Binary files differnew file mode 100644 index 000000000..fbdcfb64c --- /dev/null +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/k8s-profiles/helm_upf-profile.tar.gz diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/smf-mapping.json b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/smf-mapping.json deleted file mode 100644 index 152b9c4d1..000000000 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/smf-mapping.json +++ /dev/null @@ -1,261 +0,0 @@ -[ - { - "name": "vf-module-model-invariant-uuid", - "property": { - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-model-invariant-uuid", - "dictionary-source": "processor-db", - "dependencies": [ - "vf-module-model-customization-uuid" - ] - }, - { - "name": "vf-module-model-version", - "property": { - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-model-version", - "dictionary-source": "processor-db", - "dependencies": [ - "vf-module-model-customization-uuid" - ] - }, - { - "name": "management-prefix-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "management-prefix-id", - "dictionary-source": "processor-db", - "dependencies": [], - "version": 0 - }, - { - "name": "service-instance-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "service-instance-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vf-module-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vf-module-label", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-label", - "dictionary-source": "processor-db", - "dependencies": [ - "vf-module-model-customization-uuid" - ], - "version": 0 - }, - { - "name": "vf-module-model-customization-uuid", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-model-customization-uuid", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vf-naming-policy", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-naming-policy", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ], - "version": 0 - }, - { - "name": "vnf-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vnf-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vnf_name", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vnf_name", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ], - "version": 0 - }, - { - "name": "k8s-rb-profile-namespace", - "property": { - "description": "K8s namespace to create helm chart for specified profile", - "type": "string" - }, - "input-param": false, - "dictionary-name": "k8s-rb-profile-namespace", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "k8s-rb-profile-name", - "property": { - "description": "Profile name used in multicloud/k8s plugin to identify Helm chart(s) where this mapping is providing override values.", - "type": "string" - }, - "input-param": false, - "dictionary-name": "k8s-rb-profile-name", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "fiveg0_snssai", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "fiveg0_snssai", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "snssai", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "snssai", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.test", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "config.test", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.singletest", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "singletest", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.smfName", - "property": { - "description": "smf name", - "type": "string" - }, - "input-param": false, - "dictionary-name": "config.smfName", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "smfName", - "property": { - "description": "smf name", - "type": "string" - }, - "input-param": false, - "dictionary-name": "smfName", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.supportedNssai.sNssai.snssai", - "property": { - "description": "supportedNssai.sNssai.snssai properties", - "type": "string" - }, - "input-param": false, - "dictionary-name": "config.supportedNssai.sNssai.snssai", - "dictionary-source": "sdnc", - "dependencies": [] - } -] diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/smf-template.vtl b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/smf-template.vtl deleted file mode 100644 index c858d09f4..000000000 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/smf-template.vtl +++ /dev/null @@ -1,136 +0,0 @@ -{ - "capability-data": [ - { - "capability-name": "generate-name", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "vf_module_name", - "resource-value": "${vf-module-name}" - } - ], - "payload": [ - { - "param-name": "VF_MODULE_TYPE", - "param-value": "vfmt" - }, - { - "param-name": "resource-name", - "param-value": "vf_module_name" - }, - { - "param-name": "resource-value", - "param-value": "${vf-module-name}" - }, - { - "param-name": "external-key", - "param-value": "${vf-module-id}_vf-module-name" - }, - { - "param-name": "policy-instance-name", - "param-value": "${vf-naming-policy}" - }, - { - "param-name": "naming-type", - "param-value": "VF-MODULE" - }, - { - "param-name": "VNF_NAME", - "param-value": "${vnf_name}" - }, - { - "param-name": "VF_MODULE_LABEL", - "param-value": "${vf-module-label}" - } - ] - } - ] - }, - { - "capability-name": "aai-vf-module-put", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "aai-vf-module-put", - "resource-value": "" - } - ] - } - ] - }, - { - "capability-name": "unresolved-composite-data", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "config.smfName", - "resource-value": "${vf_module_name}" - } - ] - } - ] - }, - { - "capability-name": "unresolved-composite-data", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "smfName", - "resource-value": "${vf_module_name}" - } - ] - } - ] - } - ], - "resource-accumulator-resolved-data": [ - { - "param-name": "vf-module-model-invariant-uuid", - "param-value": "${vf-module-model-invariant-uuid}" - }, - { - "param-name": "vf-module-model-customization-uuid", - "param-value": "${vf-module-model-customization-uuid}" - }, - { - "param-name": "vnf-id", - "param-value": "${vnf-id}" - }, - { - "param-name": "config.test", - "param-value": "${config.test}" - }, - { - "param-name": "vf-module-id", - "param-value": "${vf-module-id}" - }, - { - "param-name": "k8s-rb-profile-name", - "param-value": "profile-${vf-module-id}" - }, - { - "param-name": "k8s-rb-profile-namespace", - "param-value": "ns-${vf-module-id}" - }, - { - "param-name": "fiveg0_snssai", - "param-value": "${fiveg0_snssai}" - }, - { - "param-name": "snssai", - "param-value": "${fiveg0_snssai}" - }, - { - "param-name": "config.supportedNssai.sNssai.snssai", - "param-value": "${fiveg0_snssai}" - }, - { - "param-name": "config.singletest", - "param-value": "${singletest}" - } - ] -} diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/upf-mapping.json b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/upf-mapping.json deleted file mode 100644 index 2673457cb..000000000 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/upf-mapping.json +++ /dev/null @@ -1,261 +0,0 @@ -[ - { - "name": "vf-module-model-invariant-uuid", - "property": { - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-model-invariant-uuid", - "dictionary-source": "processor-db", - "dependencies": [ - "vf-module-model-customization-uuid" - ] - }, - { - "name": "vf-module-model-version", - "property": { - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-model-version", - "dictionary-source": "processor-db", - "dependencies": [ - "vf-module-model-customization-uuid" - ] - }, - { - "name": "management-prefix-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "management-prefix-id", - "dictionary-source": "processor-db", - "dependencies": [], - "version": 0 - }, - { - "name": "service-instance-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "service-instance-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vf-module-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vf-module-label", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-label", - "dictionary-source": "processor-db", - "dependencies": [ - "vf-module-model-customization-uuid" - ], - "version": 0 - }, - { - "name": "vf-module-model-customization-uuid", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-module-model-customization-uuid", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vf-naming-policy", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vf-naming-policy", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ], - "version": 0 - }, - { - "name": "vnf-id", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vnf-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vnf_name", - "property": { - "description": "", - "required": false, - "type": "string" - }, - "input-param": false, - "dictionary-name": "vnf_name", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ], - "version": 0 - }, - { - "name": "k8s-rb-profile-namespace", - "property": { - "description": "K8s namespace to create helm chart for specified profile", - "type": "string" - }, - "input-param": false, - "dictionary-name": "k8s-rb-profile-namespace", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "k8s-rb-profile-name", - "property": { - "description": "Profile name used in multicloud/k8s plugin to identify Helm chart(s) where this mapping is providing override values.", - "type": "string" - }, - "input-param": false, - "dictionary-name": "k8s-rb-profile-name", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "fiveg0_snssai", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "fiveg0_snssai", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "snssai", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "snssai", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.test", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "config.test", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.singletest", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "singletest", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.upfName", - "property": { - "description": "upf name", - "type": "string" - }, - "input-param": false, - "dictionary-name": "config.upfName", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "upfName", - "property": { - "description": "upf name", - "type": "string" - }, - "input-param": false, - "dictionary-name": "upfName", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.supportedNssai.sNssai.snssai", - "property": { - "description": "supportedNssai.sNssai.snssai properties", - "type": "string" - }, - "input-param": false, - "dictionary-name": "config.supportedNssai.sNssai.snssai", - "dictionary-source": "sdnc", - "dependencies": [] - } -] diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/upf-template.vtl b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/upf-template.vtl deleted file mode 100644 index 75b172347..000000000 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/upf-template.vtl +++ /dev/null @@ -1,136 +0,0 @@ -{ - "capability-data": [ - { - "capability-name": "generate-name", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "vf_module_name", - "resource-value": "${vf-module-name}" - } - ], - "payload": [ - { - "param-name": "VF_MODULE_TYPE", - "param-value": "vfmt" - }, - { - "param-name": "resource-name", - "param-value": "vf_module_name" - }, - { - "param-name": "resource-value", - "param-value": "${vf-module-name}" - }, - { - "param-name": "external-key", - "param-value": "${vf-module-id}_vf-module-name" - }, - { - "param-name": "policy-instance-name", - "param-value": "${vf-naming-policy}" - }, - { - "param-name": "naming-type", - "param-value": "VF-MODULE" - }, - { - "param-name": "VNF_NAME", - "param-value": "${vnf_name}" - }, - { - "param-name": "VF_MODULE_LABEL", - "param-value": "${vf-module-label}" - } - ] - } - ] - }, - { - "capability-name": "aai-vf-module-put", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "aai-vf-module-put", - "resource-value": "" - } - ] - } - ] - }, - { - "capability-name": "unresolved-composite-data", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "config.upfName", - "resource-value": "${vf_module_name}" - } - ] - } - ] - }, - { - "capability-name": "unresolved-composite-data", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "upfName", - "resource-value": "${vf_module_name}" - } - ] - } - ] - } - ], - "resource-accumulator-resolved-data": [ - { - "param-name": "vf-module-model-invariant-uuid", - "param-value": "${vf-module-model-invariant-uuid}" - }, - { - "param-name": "vf-module-model-customization-uuid", - "param-value": "${vf-module-model-customization-uuid}" - }, - { - "param-name": "vnf-id", - "param-value": "${vnf-id}" - }, - { - "param-name": "config.test", - "param-value": "${config.test}" - }, - { - "param-name": "vf-module-id", - "param-value": "${vf-module-id}" - }, - { - "param-name": "k8s-rb-profile-name", - "param-value": "profile-${vf-module-id}" - }, - { - "param-name": "k8s-rb-profile-namespace", - "param-value": "ns-${vf-module-id}" - }, - { - "param-name": "fiveg0_snssai", - "param-value": "${fiveg0_snssai}" - }, - { - "param-name": "snssai", - "param-value": "${fiveg0_snssai}" - }, - { - "param-name": "config.supportedNssai.sNssai.snssai", - "param-value": "${fiveg0_snssai}" - }, - { - "param-name": "config.singletest", - "param-value": "${singletest}" - } - ] -} diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/vnf-mapping.json b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/vnf-mapping.json index 69bb79b94..926ca7e6e 100644 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/vnf-mapping.json +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/vnf-mapping.json @@ -1,203 +1,67 @@ [ - { - "name": "vnf-id", - "property": { - "description": "", - "required": false, - "type": "string" + { + "name": "vnf-id", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vnf-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 }, - "input-param": false, - "dictionary-name": "vnf-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "vf-naming-policy", - "property": { - "description": "", - "required": false, - "type": "string", - "default": "SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP" + { + "name": "vf-naming-policy", + "property": { + "description": "", + "required": false, + "type": "string", + "default": "SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP" + }, + "input-param": false, + "dictionary-name": "vf-naming-policy", + "dictionary-source": "default", + "dependencies": [], + "version": 0 }, - "input-param": false, - "dictionary-name": "vf-naming-policy", - "dictionary-source": "default", - "dependencies": [], - "version": 0 - }, - { - "name": "aic-cloud-region", - "property": { - "description": "", - "required": false, - "type": "string" + { + "name": "aic-cloud-region", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "aic-cloud-region", + "dictionary-source": "input", + "dependencies": [], + "version": 0 }, - "input-param": false, - "dictionary-name": "aic-cloud-region", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "service-instance-id", - "property": { - "description": "", - "required": false, - "type": "string" + { + "name": "service-instance-id", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "service-instance-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 }, - "input-param": false, - "dictionary-name": "service-instance-id", - "dictionary-source": "input", - "dependencies": [], - "version": 0 - }, - { - "name": "fiveg0_snssai", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "fiveg0_snssai", - "dictionary-source": "input", - "dependencies": [] - }, - { - "name": "snssai", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "snssai", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.test", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "config.test", - "dictionary-source": "input", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.singletest", - "property": { - "description": "", - "type": "string" - }, - "input-param": false, - "dictionary-name": "singletest", - "dictionary-source": "input", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.amfName", - "property": { - "description": "amf name", - "type": "string" - }, - "input-param": false, - "dictionary-name": "config.amfName", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "amfName", - "property": { - "description": "amf name", - "type": "string" - }, - "input-param": false, - "dictionary-name": "amfName", - "dictionary-source": "sdnc", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.smfName", - "property": { - "description": "smf name", - "type": "string" - }, - "input-param": false, - "dictionary-name": "config.smfName", - "dictionary-source": "input", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "smfName", - "property": { - "description": "smf name", - "type": "string" - }, - "input-param": false, - "dictionary-name": "smfName", - "dictionary-source": "input", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.upfName", - "property": { - "description": "upf name", - "type": "string" - }, - "input-param": false, - "dictionary-name": "config.upfName", - "dictionary-source": "input", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "upfName", - "property": { - "description": "upf name", - "type": "string" - }, - "input-param": false, - "dictionary-name": "upfName", - "dictionary-source": "input", - "dependencies": [ - "service-instance-id", - "vnf-id" - ] - }, - { - "name": "config.supportedNssai.sNssai.snssai", - "property": { - "description": "supportedNssai.sNssai.snssai properties", - "type": "string" - }, - "input-param": false, - "dictionary-name": "config.supportedNssai.sNssai.snssai", - "dictionary-source": "sdnc", - "dependencies": [] - } + { + "name": "fivegc0_snssai", + "property": { + "description": "", + "type": "string" + }, + "input-param": false, + "dictionary-name": "fivegc0_snssai", + "dictionary-source": "input", + "dependencies": [ ] + } ] +
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/vnf-template.vtl b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/vnf-template.vtl index 18ebc0035..be5b6c0f0 100644 --- a/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/vnf-template.vtl +++ b/components/model-catalog/blueprint-model/service-blueprint/5GC_Simulator_CNF_CDS/Templates/vnf-template.vtl @@ -1,73 +1,62 @@ { - "capability-data": [ - { - "capability-name": "generate-name", - "key-mapping": [ + "capability-data": [ { - "output-key-mapping": [ - { - "resource-name": "vnf_name", - "resource-value": "${vnf_name}" - } - ], - "payload": [ - { - "param-name": "resource-name", - "param-value": "vnf_name" - }, - { - "param-name": "resource-value", - "param-value": "${vnf_name}" - }, - { - "param-name": "external-key", - "param-value": "${vnf-id}_vnf_name" - }, - { - "param-name": "policy-instance-name", - "param-value": "${vf-naming-policy}" - }, - { - "param-name": "naming-type", - "param-value": "VNF" - }, - { - "param-name": "AIC_CLOUD_REGION", - "param-value": "${aic-cloud-region}" - } - ] + "capability-name": "generate-name", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "vnf_name", + "resource-value": "${vnf_name}" + } + ], + "payload": [ + { + "param-name": "resource-name", + "param-value": "vnf_name" + }, + { + "param-name": "resource-value", + "param-value": "${vnf_name}" + }, + { + "param-name": "external-key", + "param-value": "${vnf-id}_vnf_name" + }, + { + "param-name": "policy-instance-name", + "param-value": "${vf-naming-policy}" + }, + { + "param-name": "naming-type", + "param-value": "VNF" + }, + { + "param-name": "AIC_CLOUD_REGION", + "param-value": "${aic-cloud-region}" + } + ] + } + ] } - ] - } - ], - "resource-accumulator-resolved-data": [ - { - "param-name": "vnf-id", - "param-value": "${vnf-id}" - }, - { - "param-name": "vf-naming-policy", - "param-value": "${vf-naming-policy}" - }, - { - "param-name": "config.test", - "param-value": "${config.test}" - }, - { - "param-name": "fiveg0_snssai", - "param-value": "${fiveg0_snssai}" - }, - { - "param-name": "snssai", - "param-value": "${fiveg0_snssai}" - }, - { - "param-name": "config.supportedNssai.sNssai.snssai", - "param-value": "${fiveg0_snssai}" - }, - { - "param-name": "config.singletest", - "param-value": "${singletest}" - } - ] + ], + "resource-accumulator-resolved-data": [ + { + "param-name": "vnf-id", + "param-value": "${vnf-id}" + }, + { + "param-name": "vf-naming-policy", + "param-value": "${vf-naming-policy}" + }, + + { + "param-name": "fivegc0_snssai", + "param-value": "${fivegc0_snssai}" + }, + { + "param-name": "config.supportedNssai.sNssai.snssai", + "param-value": "${fivegc0_snssai}" + } + ] } |