aboutsummaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/core/src
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-08-21 04:11:57 +0000
committerMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-08-21 04:11:57 +0000
commit5285007a4e66bc18c69cef96aa32326a139d7642 (patch)
tree898fb3f81a7981c0dc2332dc5d42b87523d15162 /ms/controllerblueprints/modules/core/src
parenta3c9519d6aa7eb8e1f450a7d041047f2c0a5cc07 (diff)
Controller Blueprints Microservice
Define Controllerblueprint API DataType and Error definitions for Config model, Service Template, Model Type and Resource Dictionary Services Change-Id: I12d8d87292ec101601b0cfb7ba9670730973e318 Issue-ID: CCSDK-469 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Diffstat (limited to 'ms/controllerblueprints/modules/core/src')
-rw-r--r--ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/ConfigModelConstant.kt5
-rw-r--r--ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/data/BluePrintModel.kt9
-rw-r--r--ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt7
3 files changed, 14 insertions, 7 deletions
diff --git a/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/ConfigModelConstant.kt b/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/ConfigModelConstant.kt
index bb5a78fd9..978269125 100644
--- a/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/ConfigModelConstant.kt
+++ b/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/ConfigModelConstant.kt
@@ -42,11 +42,6 @@ object ConfigModelConstant {
const val CAPABILITY_PROPERTY_MAPPING = "mapping"
- const val SOURCE_INPUT = "input"
- const val SOURCE_DEFAULT = "default"
- const val SOURCE_MDSAL = "mdsal"
- const val SOURCE_DB = "db"
-
const val PROPERTY_RECIPE_NAMES = "action-names"
}
diff --git a/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/data/BluePrintModel.kt b/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/data/BluePrintModel.kt
index 6d677ffae..a10f6d30c 100644
--- a/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/data/BluePrintModel.kt
+++ b/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/data/BluePrintModel.kt
@@ -155,7 +155,7 @@ class PropertyDefinition {
var id: String? = null
var description: String? = null
var required: Boolean? = null
- var type: String? = null
+ lateinit var type: String
@get:JsonProperty("default")
var defaultValue: Any? = null
var status: String? = null
@@ -202,7 +202,7 @@ class OperationDefinition {
}
class Implementation {
- var primary: String? = null
+ lateinit var primary: String
var dependencies: MutableList<String>? = null
}
@@ -240,6 +240,11 @@ class TriggerDefinition {
var description: String? = null
@get:JsonProperty("event_type")
lateinit var eventType: String
+ @get:JsonProperty("target_filter")
+ var targetFilter: EventFilterDefinition? = null
+ var condition: ConditionClause? = null
+ var constraint: ConditionClause? = null
+ var method: String? = null
lateinit var action: String
}
diff --git a/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt b/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt
index 95b2af7b7..9621382c3 100644
--- a/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt
+++ b/ms/controllerblueprints/modules/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt
@@ -50,6 +50,13 @@ object JacksonUtils {
}
@JvmStatic
+ fun <T> readValueFromFile(fileName: String, valueType: Class<T>): T? {
+ val content: String = FileUtils.readFileToString(File(fileName), Charset.defaultCharset())
+ ?: throw BluePrintException(format("Failed to read json file : {}", fileName))
+ return readValue(content, valueType)
+ }
+
+ @JvmStatic
fun jsonNodeFromObject(from: kotlin.Any): JsonNode = jacksonObjectMapper().convertValue(from, JsonNode::class.java)
@JvmStatic