K8sPlugin: support UAT functionality
[ccsdk/cds.git] / ms / blueprintsprocessor / functions / k8s-connection-plugin / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / functions / k8s / instance / K8sPluginInstanceApi.kt
index 4aac2c5..b58a7ea 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright © 2017-2018 AT&T Intellectual Property.
  * Modifications Copyright © 2019 IBM.
- * Modifications Copyright © 2021 Orange.
+ * Modifications Copyright © 2022 Orange.
  * Modifications Copyright © 2020 Deutsche Telekom AG.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,9 +22,12 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance
 import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
 import com.fasterxml.jackson.module.kotlin.readValue
 import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.K8sConnectionPluginConfiguration
+import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.K8sRbInstanceRestClient.Companion.getK8sRbInstanceRestClient
 import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.healthcheck.K8sRbInstanceHealthCheck
+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
@@ -38,7 +41,7 @@ class K8sPluginInstanceApi(
     private val log = LoggerFactory.getLogger(K8sPluginInstanceApi::class.java)!!
 
     fun getInstanceList(): List<K8sRbInstance>? {
-        val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration)
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration)
         try {
             val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
                 GET.name,
@@ -53,15 +56,15 @@ 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}")
         }
     }
 
     fun getInstanceById(instanceId: String): K8sRbInstance? {
-        val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
         try {
             val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
                 GET.name,
@@ -75,10 +78,32 @@ 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}")
+        }
+    }
+
+    fun getFullInstanceById(instanceId: String): K8sRbInstanceFull? {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        try {
+            val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
+                GET.name,
+                "?full=true",
+                ""
+            )
+            log.debug(result.toString())
+            return if (result.status in 200..299) {
+                val parsedObject: K8sRbInstanceFull? = JacksonUtils.readValue(result.body, K8sRbInstanceFull::class.java)
+                parsedObject
+            } else if (result.status == 500 && result.body.contains("Error finding master table"))
+                null
+            else
+                throw BluePrintProcessorException(result.body)
+        } catch (e: Exception) {
+            log.error("Caught exception trying to get k8s rb instance")
+            throw BluePrintProcessorException("${e.message}")
         }
     }
 
@@ -98,7 +123,7 @@ class K8sPluginInstanceApi(
     }
 
     fun getInstanceStatus(instanceId: String): K8sRbInstanceStatus? {
-        val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
         try {
             val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
                 GET.name,
@@ -114,15 +139,54 @@ 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}")
+        }
+    }
+
+    fun queryInstanceStatus(
+        instanceId: String,
+        kind: String,
+        apiVersion: String,
+        name: String? = null,
+        labels: Map<String, String>? = null
+    ): K8sRbInstanceStatus? {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        try {
+            var path: String = "/query?ApiVersion=$apiVersion&Kind=$kind"
+            if (name != null)
+                path = path.plus("&Name=$name")
+            if (labels != null && labels.isNotEmpty()) {
+                path = path.plus("&Labels=")
+                for ((name, value) in labels)
+                    path = path.plus("$name%3D$value,")
+                path = path.trimEnd(',')
+            }
+            val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
+                GET.name,
+                path,
+                ""
+            )
+            log.debug(result.toString())
+            return if (result.status in 200..299) {
+                val parsedObject: K8sRbInstanceStatus? = JacksonUtils.readValue(
+                    result.body, K8sRbInstanceStatus::class.java
+                )
+                parsedObject
+            } else if (result.status == 500 && result.body.contains("Error finding master table"))
+                null
+            else
+                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}")
         }
     }
 
-    fun getInstanceHealthCheckList(instanceId: String): List<K8sRbInstanceHealthCheck>? {
-        val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId)
+    fun getInstanceHealthCheckList(instanceId: String): K8sRbInstanceHealthCheckList? {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
         try {
             val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
                 GET.name,
@@ -131,21 +195,23 @@ class K8sPluginInstanceApi(
             )
             log.debug(result.toString())
             return if (result.status in 200..299) {
-                val objectMapper = jacksonObjectMapper()
-                val parsedObject: ArrayList<K8sRbInstanceHealthCheck>? = objectMapper.readValue(result.body)
+                val parsedObject: K8sRbInstanceHealthCheckList? = JacksonUtils.readValue(
+                    result.body,
+                    K8sRbInstanceHealthCheckList::class.java
+                )
                 parsedObject
             } 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}")
         }
     }
 
     fun getInstanceHealthCheck(instanceId: String, healthCheckId: String): K8sRbInstanceHealthCheck? {
-        val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
         try {
             val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
                 GET.name,
@@ -162,15 +228,15 @@ 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}")
         }
     }
 
-    fun startInstanceHealthCheck(instanceId: String): K8sRbInstanceHealthCheck? {
-        val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId)
+    fun startInstanceHealthCheck(instanceId: String): K8sRbInstanceHealthCheckSimple? {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
         try {
             val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
                 POST.name,
@@ -179,23 +245,23 @@ class K8sPluginInstanceApi(
             )
             log.debug(result.toString())
             return if (result.status in 200..299) {
-                val parsedObject: K8sRbInstanceHealthCheck? = JacksonUtils.readValue(
+                val parsedObject: K8sRbInstanceHealthCheckSimple? = JacksonUtils.readValue(
                     result.body,
-                    K8sRbInstanceHealthCheck::class.java
+                    K8sRbInstanceHealthCheckSimple::class.java
                 )
                 parsedObject
             } 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}")
         }
     }
 
     fun createConfigurationValues(configValues: K8sConfigValueRequest, instanceId: String): K8sConfigValueResponse? {
-        val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
         try {
             val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
                 POST.name,
@@ -209,15 +275,15 @@ 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}")
+            log.error("Caught exception trying to create config instance")
+            throw BluePrintProcessorException("${e.message}")
         }
     }
 
     fun editConfigurationValues(configValues: K8sConfigValueRequest, instanceId: String, configName: String): K8sConfigValueResponse? {
-        val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
         try {
             val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
                 PUT.name,
@@ -231,19 +297,19 @@ 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}")
+            log.error("Caught exception trying to edit config instance")
+            throw BluePrintProcessorException("${e.message}")
         }
     }
 
-    fun getConfigurationValues(instanceId: String, configName: String): K8sConfigValueResponse? {
-        val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId)
+    fun editConfigurationValuesByDelete(instanceId: String, configName: String): K8sConfigValueResponse? {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
         try {
             val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
-                GET.name,
-                "/config/$configName",
+                POST.name,
+                "/config/$configName/delete",
                 ""
             )
             log.debug(result.toString())
@@ -253,37 +319,51 @@ 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}")
+            log.error("Caught exception trying to delete config instance")
+            throw BluePrintProcessorException("${e.message}")
         }
     }
 
-    fun deleteConfigurationValues(instanceId: String, configName: String) {
-        val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId)
+    fun hasConfigurationValues(instanceId: String, configName: String): Boolean {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
         try {
             val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
-                DELETE.name,
+                GET.name,
                 "/config/$configName",
                 ""
             )
             log.debug(result.toString())
-            if (result.status !in 200..299) {
-                throw BlueprintProcessorException(result.body)
-            }
+            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}")
         }
     }
 
-    fun rollbackConfigurationValues(instanceId: String): K8sConfigValueResponse? {
-        val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId)
+    fun hasConfigurationValuesVersion(instanceId: String, configName: String, version: String): Boolean {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
         try {
             val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
-                POST.name,
-                "/rollback",
+                GET.name,
+                "/config/$configName/version/$version",
+                ""
+            )
+            log.debug(result.toString())
+            return result.status in 200..299
+        } catch (e: Exception) {
+            log.error("Caught exception trying to get k8s rb instance")
+            throw BluePrintProcessorException("${e.message}")
+        }
+    }
+
+    fun getConfigurationValues(instanceId: String, configName: String): K8sConfigValueResponse? {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        try {
+            val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
+                GET.name,
+                "/config/$configName",
                 ""
             )
             log.debug(result.toString())
@@ -293,19 +373,19 @@ 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}")
+            log.error("Caught exception trying to get config instance")
+            throw BluePrintProcessorException("${e.message}")
         }
     }
 
-    fun createConfigurationValues(instanceId: String): K8sConfigValueResponse? {
-        val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId)
+    fun getConfigurationValuesVersion(instanceId: String, configName: String, version: String): K8sConfigValueResponse? {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
         try {
             val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
-                POST.name,
-                "/tagit",
+                GET.name,
+                "/config/$configName/version/$version",
                 ""
             )
             log.debug(result.toString())
@@ -315,15 +395,167 @@ 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}")
+            log.error("Caught exception trying to get config instance")
+            throw BluePrintProcessorException("${e.message}")
+        }
+    }
+
+    fun getConfigurationValuesVersionByTag(instanceId: String, configName: String, tag: String): K8sConfigValueResponse? {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        try {
+            val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
+                GET.name,
+                "/config/$configName/tag/$tag",
+                ""
+            )
+            log.debug(result.toString())
+            return if (result.status in 200..299) {
+                val parsedObject: K8sConfigValueResponse? = JacksonUtils.readValue(
+                    result.body, K8sConfigValueResponse::class.java
+                )
+                parsedObject
+            } else
+                throw BluePrintProcessorException(result.body)
+        } catch (e: Exception) {
+            log.error("Caught exception trying to get config instance")
+            throw BluePrintProcessorException("${e.message}")
+        }
+    }
+
+    fun getConfigurationValuesList(instanceId: String): List<K8sConfigValueResponse>? {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        try {
+            val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
+                GET.name,
+                "/config",
+                ""
+            )
+            log.debug(result.toString())
+            return if (result.status in 200..299) {
+                val objectMapper = jacksonObjectMapper()
+                val parsedObject: ArrayList<K8sConfigValueResponse>? = objectMapper.readValue(result.body)
+                parsedObject
+            } else if (result.status == 500 && result.body.contains("Did not find any objects with tag"))
+                null
+            else
+                throw BluePrintProcessorException(result.body)
+        } catch (e: Exception) {
+            log.error("Caught exception trying to get k8s config instance list")
+            throw BluePrintProcessorException("${e.message}")
+        }
+    }
+
+    fun getConfigurationValuesVersionList(instanceId: String, configName: String): List<K8sConfigValueResponse>? {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        try {
+            val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
+                GET.name,
+                "/config/$configName/version",
+                ""
+            )
+            log.debug(result.toString())
+            return if (result.status in 200..299) {
+                val objectMapper = jacksonObjectMapper()
+                val parsedObject: ArrayList<K8sConfigValueResponse>? = objectMapper.readValue(result.body)
+                parsedObject
+            } else if (result.status == 500 && result.body.contains("Did not find any objects with tag"))
+                null
+            else
+                throw BluePrintProcessorException(result.body)
+        } catch (e: Exception) {
+            log.error("Caught exception trying to get k8s config instance version list")
+            throw BluePrintProcessorException("${e.message}")
+        }
+    }
+
+    fun getConfigurationValuesTagList(instanceId: String, configName: String): List<K8sConfigValueTag>? {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        try {
+            val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
+                GET.name,
+                "/config/$configName/tag",
+                ""
+            )
+            log.debug(result.toString())
+            return if (result.status in 200..299) {
+                val objectMapper = jacksonObjectMapper()
+                val parsedObject: ArrayList<K8sConfigValueTag>? = objectMapper.readValue(result.body)
+                parsedObject
+            } else if (result.status == 500 && result.body.contains("Did not find any objects with tag"))
+                null
+            else
+                throw BluePrintProcessorException(result.body)
+        } catch (e: Exception) {
+            log.error("Caught exception trying to get k8s config instance tag list")
+            throw BluePrintProcessorException("${e.message}")
+        }
+    }
+
+    fun deleteConfigurationValues(instanceId: String, configName: String, deleteConfigOnly: Boolean) {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        try {
+            var path: String = "/config/$configName"
+            if (deleteConfigOnly)
+                path = path.plus("?deleteConfigOnly=true")
+            val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
+                DELETE.name,
+                path,
+                ""
+            )
+            log.debug(result.toString())
+            if (result.status !in 200..299)
+                throw BluePrintProcessorException(result.body)
+        } catch (e: Exception) {
+            log.error("Caught exception trying to delete config instance")
+            throw BluePrintProcessorException("${e.message}")
+        }
+    }
+
+    fun rollbackConfigurationValues(instanceId: String, configName: String, configVersion: String?, configTag: String?) {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        try {
+            val configValues = hashMapOf<String, String>()
+            if (configVersion != null)
+                configValues["config-version"] = configVersion
+            if (configTag != null)
+                configValues["config-tag"] = configTag
+            val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
+                POST.name,
+                "/config/$configName/rollback",
+                JacksonUtils.getJson(configValues)
+            )
+            log.debug(result.toString())
+            if (result.status !in 200..299)
+                throw BluePrintProcessorException(result.body)
+        } catch (e: Exception) {
+            log.error("Caught exception trying to rollback config instance")
+            throw BluePrintProcessorException("${e.message}")
+        }
+    }
+
+    fun tagConfigurationValues(instanceId: String, configName: String, tagName: String) {
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        try {
+            val configValues = hashMapOf<String, String>()
+            configValues["tag-name"] = tagName
+            val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
+                POST.name,
+                "/config/$configName/tagit",
+                JacksonUtils.getJson(configValues)
+            )
+            log.debug(result.toString())
+            if (result.status !in 200..299)
+                throw BluePrintProcessorException(result.body)
+        } catch (e: Exception) {
+            log.error("Caught exception trying to tag config instance")
+            throw BluePrintProcessorException("${e.message}")
         }
     }
 
     fun deleteInstanceHealthCheck(instanceId: String, healthCheckId: String) {
-        val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId)
+        val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId)
         try {
             val result: BlueprintWebClientService.WebClientResponse<String> = rbInstanceService.exchangeResource(
                 DELETE.name,
@@ -332,10 +564,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}")
         }
     }
 }