diff options
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org')
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) { |