summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/k8s-connection-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/functions/k8s-connection-plugin')
-rw-r--r--ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/K8sConnectionPluginConfiguration.kt14
-rw-r--r--ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/K8sPluginDefinitionApi.kt20
-rw-r--r--ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/profile/K8sProfileUploadComponent.kt30
-rw-r--r--ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigTemplateComponent.kt24
-rw-r--r--ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigValueComponent.kt28
-rw-r--r--ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/instance/K8sPluginInstanceApi.kt60
6 files changed, 88 insertions, 88 deletions
diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/K8sConnectionPluginConfiguration.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/K8sConnectionPluginConfiguration.kt
index 2419e5a13..cc423a09a 100644
--- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/K8sConnectionPluginConfiguration.kt
+++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/K8sConnectionPluginConfiguration.kt
@@ -17,9 +17,9 @@
package org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s
-import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintCoreConfiguration
-import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService
-import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration
+import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintCoreConfiguration
+import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertyConfiguration
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
@@ -27,12 +27,12 @@ import org.springframework.context.annotation.Import
@Configuration
@Import(
- BlueprintPropertyConfiguration::class,
- BlueprintPropertiesService::class,
- BlueprintCoreConfiguration::class
+ BluePrintPropertyConfiguration::class,
+ BluePrintPropertiesService::class,
+ BluePrintCoreConfiguration::class
)
@EnableConfigurationProperties
-open class K8sConnectionPluginConfiguration(private var bluePrintPropertiesService: BlueprintPropertiesService) {
+open class K8sConnectionPluginConfiguration(private var bluePrintPropertiesService: BluePrintPropertiesService) {
@Bean("k8s-plugin-properties")
open fun getProperties(): K8sConnectionPluginProperties {
diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/K8sPluginDefinitionApi.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/K8sPluginDefinitionApi.kt
index ae2d1f634..73c0e8029 100644
--- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/K8sPluginDefinitionApi.kt
+++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/K8sPluginDefinitionApi.kt
@@ -25,7 +25,7 @@ import com.fasterxml.jackson.module.kotlin.readValue
import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.K8sConnectionPluginConfiguration
import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.definition.template.K8sTemplate
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.slf4j.LoggerFactory
import org.springframework.http.HttpMethod.DELETE
import org.springframework.http.HttpMethod.GET
@@ -54,7 +54,7 @@ class K8sPluginDefinitionApi(
return result.status in 200..299
} catch (e: Exception) {
log.error("Caught exception trying to get k8s rb definition")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -74,7 +74,7 @@ class K8sPluginDefinitionApi(
return result.status in 200..299
} catch (e: Exception) {
log.error("Caught exception trying to get k8s rb profile")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -96,7 +96,7 @@ class K8sPluginDefinitionApi(
}
} catch (e: Exception) {
log.error("Caught exception trying to create k8s rb profile ${profile.profileName}")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -118,7 +118,7 @@ class K8sPluginDefinitionApi(
log.debug("Profile uploaded properly")
} catch (e: Exception) {
log.error("Caught exception trying to upload k8s rb profile ${profile.profileName}")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -137,7 +137,7 @@ class K8sPluginDefinitionApi(
}
} catch (e: Exception) {
log.error("Caught exception during create template")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -154,7 +154,7 @@ class K8sPluginDefinitionApi(
}
} catch (e: Exception) {
log.error("Caught exception trying to upload k8s rb template ${template.templateName}")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -172,7 +172,7 @@ class K8sPluginDefinitionApi(
}
} catch (e: Exception) {
log.error("Caught exception during get template")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -184,7 +184,7 @@ class K8sPluginDefinitionApi(
return objectMapper.readValue(result.body)
} catch (e: Exception) {
log.error("Caught exception during get template")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -196,7 +196,7 @@ class K8sPluginDefinitionApi(
return result.status in 200..299
} catch (e: Exception) {
log.error("Caught exception during get template")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/profile/K8sProfileUploadComponent.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/profile/K8sProfileUploadComponent.kt
index 80531b13d..067c75b3e 100644
--- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/profile/K8sProfileUploadComponent.kt
+++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/profile/K8sProfileUploadComponent.kt
@@ -23,7 +23,7 @@ import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.node.ArrayNode
import com.fasterxml.jackson.databind.node.ObjectNode
import org.apache.commons.io.FileUtils
-import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.K8sConnectionPluginConfiguration
import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.definition.K8sPluginDefinitionApi
@@ -31,14 +31,14 @@ import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionService
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode
import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactDefinition
import org.onap.ccsdk.cds.controllerblueprints.core.returnNullIfMissing
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintVelocityTemplateService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintVelocityTemplateService
import org.onap.ccsdk.cds.controllerblueprints.core.utils.ArchiveType
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintArchiveUtils
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintArchiveUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.config.ConfigurableBeanFactory
@@ -53,7 +53,7 @@ import java.nio.file.Paths
@Component("component-k8s-profile-upload")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
open class K8sProfileUploadComponent(
- private var bluePrintPropertiesService: BlueprintPropertiesService,
+ private var bluePrintPropertiesService: BluePrintPropertiesService,
private val resourceResolutionService: ResourceResolutionService
) :
@@ -132,7 +132,7 @@ open class K8sProfileUploadComponent(
if ((profileName == null) || (definitionName == null) || (definitionVersion == null)) {
log.warn("Prefix $prefix does not have required data for us to continue.")
} else if (!api.hasDefinition(definitionName, definitionVersion)) {
- throw BlueprintProcessorException("K8s RB Definition ($definitionName/$definitionVersion) not found ")
+ throw BluePrintProcessorException("K8s RB Definition ($definitionName/$definitionVersion) not found ")
} else if (profileName == "") {
log.warn("K8s rb profile name is empty! Either define profile name to use or choose default")
} else if (api.hasProfile(definitionName, definitionVersion, profileName)) {
@@ -144,15 +144,15 @@ open class K8sProfileUploadComponent(
val profileK8sVersion: String? = prefixInputParamsMap[INPUT_K8S_PROFILE_K8S_VERSION]?.returnNullIfMissing()?.asText()
var profileSource: String? = prefixInputParamsMap[INPUT_K8S_PROFILE_SOURCE]?.returnNullIfMissing()?.asText()
if (profileNamespace == null)
- throw BlueprintProcessorException("Profile $profileName namespace is missing")
+ throw BluePrintProcessorException("Profile $profileName namespace is missing")
if (profileSource == null) {
profileSource = profileName
log.info("Profile name used instead of profile source")
}
val bluePrintContext = bluePrintRuntimeService.bluePrintContext()
val artifact: ArtifactDefinition = bluePrintContext.nodeTemplateArtifact(nodeTemplateName, profileSource)
- if (artifact.type != BlueprintConstants.MODEL_TYPE_ARTIFACT_K8S_PROFILE)
- throw BlueprintProcessorException(
+ if (artifact.type != BluePrintConstants.MODEL_TYPE_ARTIFACT_K8S_PROFILE)
+ throw BluePrintProcessorException(
"Unexpected profile artifact type for profile source " +
"$profileSource. Expecting: $artifact.type"
)
@@ -239,19 +239,19 @@ open class K8sProfileUploadComponent(
tempProfilePath, manifestFiles
)
} else
- throw BlueprintProcessorException("Manifest file is missing")
+ throw BluePrintProcessorException("Manifest file is missing")
// Preparation of the final profile content
val finalProfileFilePath = Paths.get(
tempMainPath.toString().plus(File.separator).plus(
"$k8sRbProfileName.tar.gz"
)
)
- if (!BlueprintArchiveUtils.compress(
+ if (!BluePrintArchiveUtils.compress(
tempProfilePath, finalProfileFilePath.toFile(),
ArchiveType.TarGz
)
) {
- throw BlueprintProcessorException("Profile compression has failed")
+ throw BluePrintProcessorException("Profile compression has failed")
}
FileUtils.deleteDirectory(tempProfilePath)
@@ -261,7 +261,7 @@ open class K8sProfileUploadComponent(
throw t
}
} else
- throw BlueprintProcessorException("Profile source $ks8ProfileLocation is missing in CBA folder")
+ throw BluePrintProcessorException("Profile source $ks8ProfileLocation is missing in CBA folder")
}
private fun readManifestFiles(profileSource: File, destinationFolder: File): ArrayList<File>? {
@@ -353,7 +353,7 @@ open class K8sProfileUploadComponent(
if (!isFileInTheManifestFiles(finalFile, manifestFiles))
return
val fileContent = templatedFile.bufferedReader().readText()
- val finalFileContent = BlueprintVelocityTemplateService.generateContent(
+ val finalFileContent = BluePrintVelocityTemplateService.generateContent(
fileContent,
params.toString(), true
)
diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigTemplateComponent.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigTemplateComponent.kt
index ceb4e80e7..969277751 100644
--- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigTemplateComponent.kt
+++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigTemplateComponent.kt
@@ -23,21 +23,21 @@ import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.node.ArrayNode
import com.fasterxml.jackson.databind.node.ObjectNode
import org.apache.commons.io.FileUtils
-import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.K8sConnectionPluginConfiguration
import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.definition.K8sPluginDefinitionApi
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionService
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode
import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactDefinition
import org.onap.ccsdk.cds.controllerblueprints.core.returnNullIfMissing
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintVelocityTemplateService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintVelocityTemplateService
import org.onap.ccsdk.cds.controllerblueprints.core.utils.ArchiveType
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintArchiveUtils
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintArchiveUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
import org.slf4j.LoggerFactory
@@ -52,7 +52,7 @@ import java.nio.file.Paths
@Component("component-k8s-config-template")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
open class K8sConfigTemplateComponent(
- private var bluePrintPropertiesService: BlueprintPropertiesService,
+ private var bluePrintPropertiesService: BluePrintPropertiesService,
private val resourceResolutionService: ResourceResolutionService
) :
@@ -141,8 +141,8 @@ open class K8sConfigTemplateComponent(
}
val bluePrintContext = bluePrintRuntimeService.bluePrintContext()
val artifact: ArtifactDefinition = bluePrintContext.nodeTemplateArtifact(nodeTemplateName, templateSource)
- if (artifact.type != BlueprintConstants.MODEL_TYPE_ARTIFACT_K8S_CONFIG)
- throw BlueprintProcessorException(
+ if (artifact.type != BluePrintConstants.MODEL_TYPE_ARTIFACT_K8S_CONFIG)
+ throw BluePrintProcessorException(
"Unexpected template artifact type for template source $templateSource. Expecting: $artifact.type"
)
val template = K8sTemplate()
@@ -222,8 +222,8 @@ open class K8sConfigTemplateComponent(
"$k8sRbTemplateName.tar.gz"
)
)
- if (!BlueprintArchiveUtils.compress(tempPath, finalTemplateFilePath.toFile(), ArchiveType.TarGz)) {
- throw BlueprintProcessorException("Config template compression has failed")
+ if (!BluePrintArchiveUtils.compress(tempPath, finalTemplateFilePath.toFile(), ArchiveType.TarGz)) {
+ throw BluePrintProcessorException("Config template compression has failed")
}
FileUtils.deleteDirectory(tempPath)
@@ -233,7 +233,7 @@ open class K8sConfigTemplateComponent(
throw t
}
} else
- throw BlueprintProcessorException("Config source $k8sConfigLocation is missing in CBA folder")
+ throw BluePrintProcessorException("Config source $k8sConfigLocation is missing in CBA folder")
}
private fun templateLocation(location: File, params: JsonNode, destinationFolder: File) {
@@ -256,7 +256,7 @@ open class K8sConfigTemplateComponent(
private fun templateFile(templateFile: File, params: JsonNode, destinationFolder: File) {
val finalFile = File(destinationFolder.path.plus(File.separator).plus(templateFile.nameWithoutExtension))
val fileContent = templateFile.bufferedReader().readText()
- val finalFileContent = BlueprintVelocityTemplateService.generateContent(
+ val finalFileContent = BluePrintVelocityTemplateService.generateContent(
fileContent,
params.toString(), true
)
diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigValueComponent.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigValueComponent.kt
index 7a487f205..f1affacf4 100644
--- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigValueComponent.kt
+++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigValueComponent.kt
@@ -6,7 +6,7 @@ import com.fasterxml.jackson.databind.node.ArrayNode
import com.fasterxml.jackson.databind.node.ObjectNode
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
import com.fasterxml.jackson.module.kotlin.convertValue
-import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.K8sConnectionPluginConfiguration
import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.K8sConfigValueRequest
@@ -14,12 +14,12 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.K8sPluginIn
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionService
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonNode
import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactDefinition
import org.onap.ccsdk.cds.controllerblueprints.core.returnNullIfMissing
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintVelocityTemplateService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintVelocityTemplateService
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
import org.slf4j.LoggerFactory
@@ -33,7 +33,7 @@ import java.nio.file.Paths
@Component("component-k8s-config-value")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
open class K8sConfigValueComponent(
- private var bluePrintPropertiesService: BlueprintPropertiesService,
+ private var bluePrintPropertiesService: BluePrintPropertiesService,
private val resourceResolutionService: ResourceResolutionService
) : AbstractComponentFunction() {
@@ -105,7 +105,7 @@ open class K8sConfigValueComponent(
else if (operationType == OperationType.DELETE.toString())
deleteOperation(instanceId, configName)
else
- throw BlueprintProcessorException("Unknown operation type: $operationType")
+ throw BluePrintProcessorException("Unknown operation type: $operationType")
}
}
@@ -124,8 +124,8 @@ open class K8sConfigValueComponent(
outputPrefixStatuses[prefix] = OUTPUT_ERROR
val bluePrintContext = bluePrintRuntimeService.bluePrintContext()
val artifact: ArtifactDefinition = bluePrintContext.nodeTemplateArtifact(nodeTemplateName, valueSource)
- if (artifact.type != BlueprintConstants.MODEL_TYPE_ARTIFACT_K8S_CONFIG)
- throw BlueprintProcessorException(
+ if (artifact.type != BluePrintConstants.MODEL_TYPE_ARTIFACT_K8S_CONFIG)
+ throw BluePrintProcessorException(
"Unexpected config artifact type for config value source $valueSource. Expecting: $artifact.type"
)
val configValueRequest = K8sConfigValueRequest()
@@ -153,8 +153,8 @@ open class K8sConfigValueComponent(
outputPrefixStatuses[prefix] = OUTPUT_ERROR
val bluePrintContext = bluePrintRuntimeService.bluePrintContext()
val artifact: ArtifactDefinition = bluePrintContext.nodeTemplateArtifact(nodeTemplateName, valueSource)
- if (artifact.type != BlueprintConstants.MODEL_TYPE_ARTIFACT_K8S_CONFIG)
- throw BlueprintProcessorException(
+ if (artifact.type != BluePrintConstants.MODEL_TYPE_ARTIFACT_K8S_CONFIG)
+ throw BluePrintProcessorException(
"Unexpected config artifact type for config value source $valueSource. Expecting: $artifact.type"
)
if (api.hasConfigurationValues(instanceId, configName)) {
@@ -165,7 +165,7 @@ open class K8sConfigValueComponent(
configValueRequest.values = parseResult(valueSource, artifact.file)
api.editConfigurationValues(configValueRequest, instanceId, configName)
} else {
- throw BlueprintProcessorException("Error while getting configuration value")
+ throw BluePrintProcessorException("Error while getting configuration value")
}
}
}
@@ -189,7 +189,7 @@ open class K8sConfigValueComponent(
)
if (!configeValueSourceFilePath.toFile().exists() || configeValueSourceFilePath.toFile().isDirectory)
- throw BlueprintProcessorException("Specified config value source $k8sConfigLocation is not a file")
+ throw BluePrintProcessorException("Specified config value source $k8sConfigLocation is not a file")
var obj: Any? = null
val yamlReader = ObjectMapper(YAMLFactory())
@@ -225,7 +225,7 @@ open class K8sConfigValueComponent(
private fun templateValues(templateFile: File, params: JsonNode): String {
val fileContent = templateFile.bufferedReader().readText()
- return BlueprintVelocityTemplateService.generateContent(
+ return BluePrintVelocityTemplateService.generateContent(
fileContent,
params.toString(), true
)
@@ -238,7 +238,7 @@ open class K8sConfigValueComponent(
if (profileSourceFileFolderPath.toFile().exists() && !profileSourceFileFolderPath.toFile().isDirectory)
return profileSourceFileFolderPath.toFile()
else
- throw BlueprintProcessorException("Template value $profileSourceFileFolderPath is missing in CBA folder")
+ throw BluePrintProcessorException("Template value $profileSourceFileFolderPath is missing in CBA folder")
}
private fun getTemplatePrefixList(node: JsonNode?): ArrayList<String> {
diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/instance/K8sPluginInstanceApi.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/instance/K8sPluginInstanceApi.kt
index 3305481e1..dbcc13395 100644
--- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/instance/K8sPluginInstanceApi.kt
+++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/instance/K8sPluginInstanceApi.kt
@@ -26,7 +26,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.healthcheck
import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.healthcheck.K8sRbInstanceHealthCheckList
import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.healthcheck.K8sRbInstanceHealthCheckSimple
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.slf4j.LoggerFactory
import org.springframework.http.HttpMethod.DELETE
@@ -55,10 +55,10 @@ class K8sPluginInstanceApi(
} else if (result.status == 500 && result.body.contains("Did not find any objects with tag"))
null
else
- throw BlueprintProcessorException(result.body)
+ throw BluePrintProcessorException(result.body)
} catch (e: Exception) {
log.error("Caught exception trying to get k8s rb instance")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -77,10 +77,10 @@ class K8sPluginInstanceApi(
} else if (result.status == 500 && result.body.contains("Error finding master table"))
null
else
- throw BlueprintProcessorException(result.body)
+ throw BluePrintProcessorException(result.body)
} catch (e: Exception) {
log.error("Caught exception trying to get k8s rb instance")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -116,10 +116,10 @@ class K8sPluginInstanceApi(
} else if (result.status == 500 && result.body.contains("Error finding master table"))
null
else
- throw BlueprintProcessorException(result.body)
+ throw BluePrintProcessorException(result.body)
} catch (e: Exception) {
log.error("Caught exception trying to get k8s rb instance")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -155,10 +155,10 @@ class K8sPluginInstanceApi(
} else if (result.status == 500 && result.body.contains("Error finding master table"))
null
else
- throw BlueprintProcessorException(result.body)
+ throw BluePrintProcessorException(result.body)
} catch (e: Exception) {
log.error("Caught exception trying to get k8s rb instance")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -180,10 +180,10 @@ class K8sPluginInstanceApi(
} else if (result.status == 500 && result.body.contains("Error finding master table"))
null
else
- throw BlueprintProcessorException(result.body)
+ throw BluePrintProcessorException(result.body)
} catch (e: Exception) {
log.error("Caught exception trying to get k8s rb instance")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -205,10 +205,10 @@ class K8sPluginInstanceApi(
} else if (result.status == 500 && result.body.contains("Error finding master table"))
null
else
- throw BlueprintProcessorException(result.body)
+ throw BluePrintProcessorException(result.body)
} catch (e: Exception) {
log.error("Caught exception trying to get k8s rb instance")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -230,10 +230,10 @@ class K8sPluginInstanceApi(
} else if (result.status == 500 && result.body.contains("Error finding master table"))
null
else
- throw BlueprintProcessorException(result.body)
+ throw BluePrintProcessorException(result.body)
} catch (e: Exception) {
log.error("Caught exception trying to get k8s rb instance")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -252,10 +252,10 @@ class K8sPluginInstanceApi(
)
parsedObject
} else
- throw BlueprintProcessorException(result.body)
+ throw BluePrintProcessorException(result.body)
} catch (e: Exception) {
log.error("Caught exception trying to create config instance")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -274,10 +274,10 @@ class K8sPluginInstanceApi(
)
parsedObject
} else
- throw BlueprintProcessorException(result.body)
+ throw BluePrintProcessorException(result.body)
} catch (e: Exception) {
log.error("Caught exception trying to edit config instance")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -293,7 +293,7 @@ class K8sPluginInstanceApi(
return result.status in 200..299
} catch (e: Exception) {
log.error("Caught exception trying to get k8s rb instance")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -312,10 +312,10 @@ class K8sPluginInstanceApi(
)
parsedObject
} else
- throw BlueprintProcessorException(result.body)
+ throw BluePrintProcessorException(result.body)
} catch (e: Exception) {
log.error("Caught exception trying to get config instance")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -329,10 +329,10 @@ class K8sPluginInstanceApi(
)
log.debug(result.toString())
if (result.status !in 200..299)
- throw BlueprintProcessorException(result.body)
+ throw BluePrintProcessorException(result.body)
} catch (e: Exception) {
log.error("Caught exception trying to delete config instance")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -351,10 +351,10 @@ class K8sPluginInstanceApi(
)
parsedObject
} else
- throw BlueprintProcessorException(result.body)
+ throw BluePrintProcessorException(result.body)
} catch (e: Exception) {
log.error("Caught exception trying to get k8s rb instance")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -373,10 +373,10 @@ class K8sPluginInstanceApi(
)
parsedObject
} else
- throw BlueprintProcessorException(result.body)
+ throw BluePrintProcessorException(result.body)
} catch (e: Exception) {
log.error("Caught exception trying to get k8s rb instance")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
@@ -390,10 +390,10 @@ class K8sPluginInstanceApi(
)
log.debug(result.toString())
if (result.status !in 200..299)
- throw BlueprintProcessorException(result.body)
+ throw BluePrintProcessorException(result.body)
} catch (e: Exception) {
log.error("Caught exception trying to get k8s rb instance")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
}