aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src/main
diff options
context:
space:
mode:
authorBrinda Santh <brindasanth@in.ibm.com>2019-08-05 12:24:33 -0400
committerDan Timoney <dtimoney@att.com>2019-08-09 22:15:21 +0000
commitafcd99e9dc0d765758be1d91ab862afa54d244dd (patch)
tree39f68621f7d1a807cec0e1a66f53864c314d8587 /ms/blueprintsprocessor/functions/resource-resolution/src/main
parent977287b586e27e2f835a5d24950abf1f2adae8be (diff)
Add class model for workflow and resource data type.
Change-Id: Ia42f56541bef0418dddb797c019ecda3afa6983b Issue-ID: CCSDK-1380 Signed-off-by: Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/main')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSL.kt5
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSL.kt5
2 files changed, 10 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSL.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSL.kt
index 1b02ebe70..141bad619 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSL.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSL.kt
@@ -18,6 +18,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeTemplate
+import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.PropertyDefinitionBuilder
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDefinition
@@ -73,6 +74,10 @@ class ResourceDefinitionBuilder(private val name: String, private val descriptio
resourceDefinition.tags = tags
}
+ fun property(property: PropertyDefinition) {
+ resourceDefinition.property = property
+ }
+
fun property(type: String, required: Boolean) {
resourceDefinition.property = PropertyDefinitionBuilder(name, type, required, description).build()
}
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSL.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSL.kt
index b1d694859..182f3a178 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSL.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceDSL.kt
@@ -24,6 +24,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeType
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.AbstractNodeTemplatePropertyImplBuilder
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.PropertiesAssignmentBuilder
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.nodeType
+import kotlin.reflect.KClass
fun BluePrintTypes.nodeTypeSourceInput(): NodeType {
return nodeType(id = "source-input", version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
@@ -311,6 +312,10 @@ class SourceCapabilityNodeTemplateBuilder(id: String, description: String) :
property(ComponentScriptExecutor.INPUT_SCRIPT_TYPE, type)
}
+ fun scriptClassReference(scriptClassReference: KClass<*>) {
+ scriptClassReference(scriptClassReference.qualifiedName!!)
+ }
+
fun scriptClassReference(scriptClassReference: String) = scriptClassReference(scriptClassReference.asJsonPrimitive())
fun scriptClassReference(scriptClassReference: JsonNode) {