interface BluePrintNodeTypeEnhancer : BluePrintEnhancer<NodeType>
+interface BluePrintArtifactDefinitionEnhancer : BluePrintEnhancer<ArtifactDefinition>
+
interface BluePrintPolicyTypeEnhancer : BluePrintEnhancer<PolicyType>
interface BluePrintPropertyDefinitionEnhancer : BluePrintEnhancer<PropertyDefinition>
fun getNodeTypeEnhancers(): List<BluePrintNodeTypeEnhancer>
+ fun getArtifactDefinitionEnhancers(): List<BluePrintArtifactDefinitionEnhancer>
+
fun getPolicyTypeEnhancers(): List<BluePrintPolicyTypeEnhancer>
fun getPropertyDefinitionEnhancers(): List<BluePrintPropertyDefinitionEnhancer>
doEnhancement(bluePrintRuntimeService, name, nodeType, enhancers)
}
+ fun enhanceArtifactDefinition(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, artifactDefinition: ArtifactDefinition) {
+ val enhancers = getArtifactDefinitionEnhancers()
+ doEnhancement(bluePrintRuntimeService, name, artifactDefinition, enhancers)
+ }
+
fun enhancePolicyType(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, policyType: PolicyType) {
val enhancers = getPolicyTypeEnhancers()
doEnhancement(bluePrintRuntimeService, name, policyType, enhancers)
\r
fun get(key: String): JsonNode?\r
\r
+ fun check(key: String): Boolean\r
+\r
fun cleanRuntime()\r
\r
fun getAsString(key: String): String?\r
open class DefaultBluePrintRuntimeService(private var id: String, private var bluePrintContext: BluePrintContext)\r
: BluePrintRuntimeService<MutableMap<String, JsonNode>> {\r
\r
+ @Transient\r
private val log: EELFLogger = EELFManager.getInstance().getLogger(BluePrintRuntimeService::class.toString())\r
\r
private var store: MutableMap<String, JsonNode> = hashMapOf()\r
return store[key] ?: throw BluePrintProcessorException("failed to get execution property($key)")\r
}\r
\r
+ override fun check(key: String): Boolean {\r
+ return store.containsKey(key)\r
+ }\r
+\r
override fun cleanRuntime() {\r
store.clear()\r
}\r
package org.onap.ccsdk.apps.controllerblueprints.core.utils
+import kotlinx.coroutines.async
+import kotlinx.coroutines.runBlocking
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream
import org.apache.commons.io.IOUtils
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException
import java.io.*
import java.nio.charset.Charset
companion object {
+ fun getFileContent(fileName: String): String = runBlocking {
+ async {
+ try {
+ File(fileName).readText(Charsets.UTF_8)
+ } catch (e: Exception) {
+ throw BluePrintException("couldn't find file($fileName)")
+ }
+ }.await()
+ }
fun compress(source: String, destination: String, absolute: Boolean): Boolean {
val rootDir = File(source)
import reactor.core.publisher.Mono\r
import reactor.core.publisher.toMono\r
\r
+@Deprecated("Reactor will be replaced by coroutines by default")\r
object JacksonReactorUtils {\r
private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
\r
import com.fasterxml.jackson.databind.SerializationFeature\r
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper\r
import kotlinx.coroutines.Dispatchers\r
+import kotlinx.coroutines.async\r
import kotlinx.coroutines.runBlocking\r
import kotlinx.coroutines.withContext\r
import org.apache.commons.io.IOUtils\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants\r
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintTypes\r
import java.io.File\r
import java.nio.charset.Charset\r
}\r
\r
@JvmStatic\r
- fun getContent(fileName: String): String {\r
- return runBlocking {\r
- withContext(Dispatchers.Default) {\r
+ fun getContent(fileName: String): String = runBlocking {\r
+ async {\r
+ try {\r
File(fileName).readText(Charsets.UTF_8)\r
+ } catch (e: Exception) {\r
+ throw BluePrintException("couldn't get file ($fileName) content : ${e.message}")\r
}\r
- }\r
+ }.await()\r
}\r
\r
@JvmStatic\r
open fun checkValidArtifactType(artifactDefinitionName: String, artifactTypeName: String) {
val artifactType = bluePrintContext.serviceTemplate.artifactTypes?.get(artifactTypeName)
- ?: throw BluePrintException("failed to artifactType($artifactTypeName) for ArtifactDefinition($artifactDefinitionName)")
+ ?: throw BluePrintException("failed to get artifactType($artifactTypeName) for ArtifactDefinition($artifactDefinitionName)")
checkValidArtifactTypeDerivedFrom(artifactTypeName, artifactType.derivedFrom)
}
package org.onap.ccsdk.apps.controllerblueprints.core.service\r
\r
import org.junit.Test\r
-import java.io.FileNotFoundException\r
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException\r
import kotlin.test.assertNotNull\r
\r
/**\r
assertNotNull(nodeType, "Failed to get ArtifactType from repo")\r
}\r
\r
- @Test(expected = FileNotFoundException::class)\r
+ @Test(expected = BluePrintException::class)\r
fun testModelNotFound() {\r
val dataType = bluePrintRepoFileService.getDataType("dt-not-found")\r
assertNotNull(dataType, "Failed to get DataType from repo")\r
import com.att.eelf.configuration.EELFLogger\r
import com.att.eelf.configuration.EELFManager\r
import org.junit.Test\r
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate\r
-import java.io.FileNotFoundException\r
import kotlin.test.assertEquals\r
import kotlin.test.assertNotNull\r
\r
+@Deprecated("Reactor will be replacecd by coroutines by default.")\r
class JacksonReactorUtilsTest {\r
private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
@Test\r
assertNotNull(jsonContent, "Failed to get json Node")\r
}\r
\r
- @Test(expected = FileNotFoundException::class)\r
+ @Test(expected = BluePrintException::class)\r
fun testReadValuesFailure() {\r
JacksonReactorUtils.jsonNodeFromFile("load/blueprints/not-found.json")\r
.block()\r
--- /dev/null
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.controllerblueprints.service.enhancer
+
+import com.att.eelf.configuration.EELFLogger
+import com.att.eelf.configuration.EELFManager
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException
+import org.onap.ccsdk.apps.controllerblueprints.core.asJsonPrimitive
+import org.onap.ccsdk.apps.controllerblueprints.core.data.ArtifactDefinition
+import org.onap.ccsdk.apps.controllerblueprints.core.data.ArtifactType
+import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintArtifactDefinitionEnhancer
+import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintRepoService
+import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService
+import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintContext
+import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRuntimeService
+import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment
+import org.springframework.stereotype.Service
+
+@Service
+open class BluePrintArtifactDefinitionEnhancerImpl(private val bluePrintRepoService: BluePrintRepoService,
+ private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService,
+ private val resourceAssignmentEnhancerService: ResourceAssignmentEnhancerService)
+ : BluePrintArtifactDefinitionEnhancer {
+
+ companion object {
+ const val ARTIFACT_TYPE_MAPPING_SOURCE: String = "artifact-mapping-resource"
+ }
+
+
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(BluePrintArtifactDefinitionEnhancerImpl::class.toString())
+
+ lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*>
+ lateinit var bluePrintContext: BluePrintContext
+
+
+ override fun enhance(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, artifactDefinition: ArtifactDefinition) {
+ log.info("enhancing ArtifactDefinition($name)")
+
+ this.bluePrintRuntimeService = bluePrintRuntimeService
+ this.bluePrintContext = bluePrintRuntimeService.bluePrintContext()
+
+ val artifactTypeName = artifactDefinition.type
+ ?: throw BluePrintException("Artifact type is missing for ArtifactDefinition($name)")
+
+ // Populate Artifact Type
+ populateArtifactType(artifactTypeName)
+
+ when (artifactTypeName) {
+ ARTIFACT_TYPE_MAPPING_SOURCE -> {
+ enhanceMappingType(name, artifactDefinition)
+ }
+ }
+ }
+
+ // Enhance Resource Mapping
+ open fun enhanceMappingType(name: String, artifactDefinition: ArtifactDefinition) {
+
+ val artifactFilePath = "${bluePrintContext.rootPath}/${artifactDefinition.file}"
+
+ val alreadyEnhancedKey = "enhanced-${artifactDefinition.file}"
+ val alreadyEnhanced = bluePrintRuntimeService.check(alreadyEnhancedKey)
+
+ log.info("enhancing resource mapping file(${artifactDefinition.file}) already enhanced($alreadyEnhanced)")
+
+ if (!alreadyEnhanced) {
+ val resourceAssignments: MutableList<ResourceAssignment> = JacksonUtils.getListFromFile(artifactFilePath, ResourceAssignment::class.java)
+ as? MutableList<ResourceAssignment>
+ ?: throw BluePrintProcessorException("couldn't get ResourceAssignment definitions for the file($artifactFilePath)")
+
+ // Call Resource Assignment Enhancer
+ resourceAssignmentEnhancerService.enhanceBluePrint(bluePrintTypeEnhancerService, bluePrintRuntimeService, resourceAssignments)
+
+ bluePrintRuntimeService.put(alreadyEnhancedKey, true.asJsonPrimitive())
+ }
+ }
+
+ open fun populateArtifactType(artifactTypeName: String): ArtifactType {
+
+ val artifactType = bluePrintContext.serviceTemplate.artifactTypes?.get(artifactTypeName)
+ ?: bluePrintRepoService.getArtifactType(artifactTypeName)
+ ?: throw BluePrintException("couldn't get ArtifactType($artifactTypeName) from repo.")
+ bluePrintContext.serviceTemplate.artifactTypes?.put(artifactTypeName, artifactType)
+ return artifactType
+ }
+}
\ No newline at end of file
import com.att.eelf.configuration.EELFLogger
import com.att.eelf.configuration.EELFManager
-import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintError
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException
-import org.onap.ccsdk.apps.controllerblueprints.core.data.ArtifactType
import org.onap.ccsdk.apps.controllerblueprints.core.data.NodeTemplate
import org.onap.ccsdk.apps.controllerblueprints.core.data.NodeType
import org.onap.ccsdk.apps.controllerblueprints.core.format
override fun enhance(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, nodeTemplate: NodeTemplate) {
- log.info("Enhancing NodeTemplate($name)")
+ log.info("***** Enhancing NodeTemplate($name)")
this.bluePrintRuntimeService = bluePrintRuntimeService
this.bluePrintContext = bluePrintRuntimeService.bluePrintContext()
open fun enhanceNodeTemplateArtifactDefinition(nodeTemplateName: String, nodeTemplate: NodeTemplate) {
nodeTemplate.artifacts?.forEach { artifactDefinitionName, artifactDefinition ->
- val artifactTypeName = artifactDefinition.type
- ?: throw BluePrintException(format("Artifact type is missing for NodeTemplate({}) artifact({})", nodeTemplateName, artifactDefinitionName))
-
- // Populate Artifact Type
- populateArtifactType(artifactTypeName)
+ // Enhance Artifacct Definitions
+ bluePrintTypeEnhancerService.enhanceArtifactDefinition(bluePrintRuntimeService, artifactDefinitionName, artifactDefinition)
}
}
- open fun populateArtifactType(artifactTypeName: String): ArtifactType {
- val artifactType = bluePrintContext.serviceTemplate.artifactTypes?.get(artifactTypeName)
- ?: bluePrintRepoService.getArtifactType(artifactTypeName)
- ?: throw BluePrintException(format("Couldn't get ArtifactType({}) from repo.", artifactTypeName))
- bluePrintContext.serviceTemplate.artifactTypes?.put(artifactTypeName, artifactType)
- return artifactType
- }
-
}
\ No newline at end of file
open class BluePrintServiceTemplateEnhancerImpl(private val bluePrintRepoService: BluePrintRepoService,
private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService)
: BluePrintServiceTemplateEnhancer {
- private val log: EELFLogger = EELFManager.getInstance().getLogger(BluePrintEnhancerServiceImpl::class.toString())
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(BluePrintServiceTemplateEnhancerImpl::class.toString())
lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*>
return context.getBeansOfType(BluePrintNodeTypeEnhancer::class.java).map { it.value }
}
+ override fun getArtifactDefinitionEnhancers(): List<BluePrintArtifactDefinitionEnhancer> {
+ return context.getBeansOfType(BluePrintArtifactDefinitionEnhancer::class.java).map { it.value }
+ }
+
override fun getPolicyTypeEnhancers(): List<BluePrintPolicyTypeEnhancer> {
return context.getBeansOfType(BluePrintPolicyTypeEnhancer::class.java).map { it.value }
}
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.apps.controllerblueprints.core.ConfigModelConstant
+import org.onap.ccsdk.apps.controllerblueprints.core.asJsonPrimitive
import org.onap.ccsdk.apps.controllerblueprints.core.data.DataType
import org.onap.ccsdk.apps.controllerblueprints.core.data.PropertyDefinition
import org.onap.ccsdk.apps.controllerblueprints.core.data.Workflow
private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService,
private val resourceAssignmentEnhancerService: ResourceAssignmentEnhancerService)
: BluePrintWorkflowEnhancer {
- private val log: EELFLogger = EELFManager.getInstance().getLogger(BluePrintNodeTemplateEnhancerImpl::class.toString())
+ private val log: EELFLogger = EELFManager.getInstance().getLogger(BluePrintWorkflowEnhancerImpl::class.toString())
+
+ companion object {
+ const val ARTIFACT_TYPE_MAPPING_SOURCE: String = "artifact-mapping-resource"
+ const val PROPERTY_DEPENDENCY_NODE_TEMPLATES = "dependency-node-templates"
+ }
lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*>
lateinit var bluePrintContext: BluePrintContext
- val PROPERTY_DEPENDENCY_NODE_TEMPLATES = "dependency-node-templates"
-
-
private val workflowDataTypes: MutableMap<String, DataType> = hashMapOf()
override fun enhance(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, workflow: Workflow) {
- log.info("Enhancing Workflow($name)")
- this.bluePrintRuntimeService = bluePrintRuntimeService
+ log.info("##### Enhancing Workflow($name)")
+ this.bluePrintRuntimeService = bluePrintRuntimeService
this.bluePrintContext = bluePrintRuntimeService.bluePrintContext()
val dynamicPropertyName = "$name-properties"
// Check and Get Resource Assignment File
val resourceAssignmentArtifacts = dependencyNodeTemplates?.mapNotNull { componentNodeTemplateName ->
- log.info("Identified workflow($name) targets($componentNodeTemplateName")
+ log.info("identified workflow($name) targets($componentNodeTemplateName)")
+
val resourceAssignmentArtifacts = bluePrintContext.nodeTemplateByName(componentNodeTemplateName)
.artifacts?.filter {
- it.value.type == "artifact-mapping-resource"
+ it.value.type == ARTIFACT_TYPE_MAPPING_SOURCE
}?.map {
log.info("resource assignment artifacts(${it.key}) for NodeType(${componentNodeTemplateName})")
it.value.file
resourceAssignmentArtifacts
}?.flatten()
- log.info("Workflow($name) resource assignment files($resourceAssignmentArtifacts")
+ log.info("workflow($name) resource assignment files($resourceAssignmentArtifacts")
if (resourceAssignmentArtifacts != null && resourceAssignmentArtifacts.isNotEmpty()) {
addWorkFlowDynamicPropertyDefinitions(name, workflow)
resourceAssignmentArtifacts.forEach { fileName ->
-
- val absoluteFilePath = "${bluePrintContext.rootPath}/$fileName"
-
- log.info("enriching workflow($name) artifacts file(${absoluteFilePath}")
// Enhance Resource Assignment File
- val resourceAssignmentProperties = enhanceResourceAssignmentFile(absoluteFilePath)
+ val resourceAssignmentProperties = enhanceResourceAssignmentFile(fileName!!)
// Add Workflow Dynamic DataType
addWorkFlowDynamicDataType(name, resourceAssignmentProperties)
}
}
}
- private fun enhanceResourceAssignmentFile(filePath: String): MutableMap<String, PropertyDefinition> {
+ // Enhancement for Dynamic Properties, Resource Assignment Properties, Resource Sources
+ private fun enhanceResourceAssignmentFile(fileName: String): MutableMap<String, PropertyDefinition> {
+
+ val filePath = "${bluePrintContext.rootPath}/$fileName"
+
+ log.info("enriching artifacts file(${filePath}")
val resourceAssignmentProperties: MutableMap<String, PropertyDefinition> = hashMapOf()
as? MutableList<ResourceAssignment>
?: throw BluePrintProcessorException("couldn't get ResourceAssignment definitions for the file($filePath)")
- // Call Resource Assignment Enhancer
- resourceAssignmentEnhancerService.enhanceBluePrint(bluePrintTypeEnhancerService, bluePrintRuntimeService, resourceAssignments)
+ val alreadyEnhancedKey = "enhanced-$fileName"
+ val alreadyEnhanced = bluePrintRuntimeService.check(alreadyEnhancedKey)
+
+ log.info("enhancing workflow resource mapping file($fileName) already enhanced($alreadyEnhanced)")
+
+ if (!alreadyEnhanced) {
+ // Call Resource Assignment Enhancer
+ resourceAssignmentEnhancerService.enhanceBluePrint(bluePrintTypeEnhancerService, bluePrintRuntimeService, resourceAssignments)
+ bluePrintRuntimeService.put(alreadyEnhancedKey, true.asJsonPrimitive())
+ }
resourceAssignments.forEach { resourceAssignment ->
resourceAssignmentProperties[resourceAssignment.name] = resourceAssignment.property!!
var recipeDataType: DataType? = bluePrintContext.serviceTemplate.dataTypes?.get(dataTypeName)
if (recipeDataType == null) {
- log.info("DataType not present for the recipe({})", dataTypeName)
+ log.info("dataType not present for the recipe({})", dataTypeName)
recipeDataType = DataType()
recipeDataType.version = "1.0.0"
recipeDataType.description = "Dynamic DataType definition for workflow($workflowName)."
bluePrintContext.serviceTemplate.dataTypes?.put(dataTypeName, recipeDataType)
} else {
- log.info("Dynamic dataType($dataTypeName) already present for workflow($workflowName).")
+ log.info("dynamic dataType($dataTypeName) already present for workflow($workflowName).")
}
// Merge all the Recipe Properties
mappingProperties.forEach { propertyName, propertyDefinition ->
"tosca_definitions_version" : "controller_blueprint_1_0_0",
"artifact_types" : { },
"data_types" : {
- "dt-v4-aggregate" : {
- "description" : "This is dt-v4-aggregate Data Type",
- "version" : "1.0.0",
- "properties" : {
- "ipv4-address" : {
- "required" : true,
- "type" : "string"
- },
- "ipv4-plen" : {
- "required" : false,
- "type" : "integer"
- }
- },
- "derived_from" : "tosca.datatypes.Root"
- },
- "dt-license-key" : {
- "description" : "This is dt-plicense-key Data Type",
- "version" : "1.0.0",
- "properties" : {
- "license-key" : {
- "required" : true,
- "type" : "string"
- }
- },
- "derived_from" : "tosca.datatypes.Root"
- },
- "datatype-resource-assignment" : {
- "description" : "This is Resource Assignment Data Type",
- "version" : "1.0.0",
- "properties" : {
- "property" : {
- "required" : true,
- "type" : "datatype-property"
- },
- "input-param" : {
- "required" : true,
- "type" : "boolean"
- },
- "dictionary-name" : {
- "required" : false,
- "type" : "string"
- },
- "dictionary-source" : {
- "required" : false,
- "type" : "string"
- },
- "dependencies" : {
- "required" : true,
- "type" : "list",
- "entry_schema" : {
- "type" : "string"
- }
- },
- "status" : {
- "required" : false,
- "type" : "string"
- },
- "message" : {
- "required" : false,
- "type" : "string"
- },
- "updated-date" : {
- "required" : false,
- "type" : "string"
- },
- "updated-by" : {
- "required" : false,
- "type" : "string"
- }
- },
- "derived_from" : "tosca.datatypes.Root"
- },
- "datatype-property" : {
- "description" : "This is Entry point Input Data Type, which is dynamic datatype, The parameter names will be populated during the Design time for each inputs",
- "version" : "1.0.0",
- "properties" : {
- "type" : {
- "required" : true,
- "type" : "string"
- },
- "description" : {
- "required" : false,
- "type" : "string"
- },
- "required" : {
- "required" : false,
- "type" : "boolean"
- },
- "default" : {
- "required" : false,
- "type" : "string"
- },
- "entry_schema" : {
- "required" : false,
- "type" : "string"
- }
- },
- "derived_from" : "tosca.datatypes.Root"
- },
- "dt-resource-assignment-request" : {
- "description" : "This is Dynamic Data type definition generated from resource mapping for the config template name base-config-template.",
- "version" : "1.0.0",
- "properties" : {
- "hostname" : {
- "required" : true,
- "type" : "string"
- },
- "licenses" : {
- "required" : true,
- "type" : "list",
- "entry_schema" : {
- "type" : "dt-license-key"
- }
- },
- "rs-db-source" : {
- "required" : true,
- "type" : "string"
- },
- "service" : {
- "required" : true,
- "type" : "string"
- },
- "service-instance-id" : {
- "required" : true,
- "type" : "string"
- },
- "mdsal-source" : {
- "description" : "",
- "required" : true,
- "type" : "list",
- "entry_schema" : {
- "type" : "dt-v4-aggregate"
- }
- }
- },
- "derived_from" : "tosca.datatypes.Dynamic"
- }
},
"node_types" : {
- "dg-resource-assignment" : {
- "description" : "This is Resource Assignment Directed Graph",
- "version" : "1.0.0",
- "properties" : {
- "mode" : {
- "required" : false,
- "type" : "string",
- "default" : "sync"
- },
- "version" : {
- "required" : false,
- "type" : "string",
- "default" : "LATEST"
- },
- "is-start-flow" : {
- "required" : false,
- "type" : "boolean",
- "default" : false
- }
- },
- "capabilities" : {
- "dg-node" : {
- "type" : "tosca.capabilities.Node"
- }
- },
- "requirements" : {
- "component-dependency" : {
- "capability" : "component-node",
- "node" : "component-resource-assignment",
- "relationship" : "tosca.relationships.DependsOn"
- }
- },
- "interfaces" : {
- "CONFIG" : {
- "operations" : {
- "ResourceAssignment" : {
- "inputs" : {
- "params" : {
- "required" : false,
- "type" : "list",
- "entry_schema" : {
- "type" : "datatype-property"
- }
- }
- }
- }
- }
- }
- },
- "derived_from" : "tosca.nodes.DG"
- },
- "tosca.nodes.Component" : {
- "description" : "This is default Component Node",
- "version" : "1.0.0",
- "derived_from" : "tosca.nodes.Root"
- },
- "artifact-config-template" : {
- "description" : "This is Configuration Velocity Template",
- "version" : "1.0.0",
- "properties" : {
- "action-names" : {
- "required" : true,
- "type" : "list",
- "entry_schema" : {
- "type" : "string"
- }
- }
- },
- "capabilities" : {
- "content" : {
- "type" : "tosca.capabilities.Content",
- "properties" : {
- "content" : {
- "required" : true,
- "type" : "string"
- }
- }
- },
- "mapping" : {
- "type" : "tosca.capabilities.Mapping",
- "properties" : {
- "mapping" : {
- "required" : false,
- "type" : "list",
- "entry_schema" : {
- "type" : "datatype-resource-assignment"
- }
- }
- }
- }
- },
- "derived_from" : "tosca.nodes.Artifact"
- },
- "tosca.nodes.Vnf" : {
- "description" : "This is VNF Node Type",
- "version" : "1.0.0",
- "derived_from" : "tosca.nodes.Root"
- },
- "tosca.nodes.Artifact" : {
- "description" : "This is Deprecated Artifact Node Type.",
- "version" : "1.0.0",
- "derived_from" : "tosca.nodes.Root"
- },
- "dg-activate-netconf" : {
- "description" : "This is Download Netconf Directed Graph",
- "version" : "1.0.0",
- "properties" : {
- "mode" : {
- "required" : false,
- "type" : "string",
- "default" : "sync"
- },
- "version" : {
- "required" : false,
- "type" : "string",
- "default" : "LATEST"
- },
- "is-start-flow" : {
- "required" : false,
- "type" : "boolean",
- "default" : false
- }
- },
- "capabilities" : {
- "dg-node" : {
- "type" : "tosca.capabilities.Node"
- }
- },
- "requirements" : {
- "component-dependency" : {
- "capability" : "component-node",
- "node" : "component-netconf-executor",
- "relationship" : "tosca.relationships.DependsOn"
- }
- },
- "interfaces" : {
- "CONFIG" : {
- "operations" : {
- "ActivateNetconf" : {
- "inputs" : {
- "params" : {
- "required" : false,
- "type" : "list",
- "entry_schema" : {
- "type" : "datatype-property"
- }
- }
- }
- }
- }
- }
- },
- "derived_from" : "tosca.nodes.DG"
- },
- "source-input" : {
- "description" : "This is Input Resource Source Node Type",
- "version" : "1.0.0",
- "properties" : {
- "key" : {
- "required" : false,
- "type" : "string"
- },
- "key-dependencies" : {
- "required" : true,
- "type" : "list",
- "entry_schema" : {
- "type" : "string"
- }
- }
- },
- "derived_from" : "tosca.nodes.ResourceSource"
- },
- "tosca.nodes.ResourceSource" : {
- "description" : "TOSCA base type for Resource Sources",
- "version" : "1.0.0",
- "derived_from" : "tosca.nodes.Root"
- },
- "component-resource-assignment" : {
- "description" : "This is Resource Assignment Component API",
- "version" : "1.0.0",
- "capabilities" : {
- "component-node" : {
- "type" : "tosca.capabilities.Node"
- }
- },
- "interfaces" : {
- "ResourceAssignmentComponent" : {
- "operations" : {
- "process" : {
- "inputs" : {
- "template-name" : {
- "description" : "Service Template Name.",
- "required" : true,
- "type" : "string"
- },
- "template-version" : {
- "description" : "Service Template Version.",
- "required" : true,
- "type" : "string"
- },
- "resource-type" : {
- "description" : "Request type.",
- "required" : true,
- "type" : "string"
- },
- "template-names" : {
- "description" : "Name of the artifact Node Templates, to get the template Content.",
- "required" : true,
- "type" : "list",
- "entry_schema" : {
- "type" : "string"
- }
- },
- "request-id" : {
- "description" : "Request Id, Unique Id for the request.",
- "required" : true,
- "type" : "string"
- },
- "resource-id" : {
- "description" : "Resource Id.",
- "required" : true,
- "type" : "string"
- },
- "action-name" : {
- "description" : "Action Name of the process",
- "required" : true,
- "type" : "string"
- }
- },
- "outputs" : {
- "resource-assignment-params" : {
- "required" : true,
- "type" : "string"
- },
- "status" : {
- "required" : true,
- "type" : "string"
- }
- }
- }
- }
- }
- },
- "derived_from" : "tosca.nodes.Component"
- },
- "tosca.nodes.component.Jython" : {
- "description" : "This is Jython Component",
- "version" : "1.0.0",
- "derived_from" : "tosca.nodes.Root"
- },
- "tosca.nodes.DG" : {
- "description" : "This is Directed Graph Node Type",
- "version" : "1.0.0",
- "derived_from" : "tosca.nodes.Root"
- },
- "source-db" : {
- "description" : "This is Database Resource Source Node Type",
- "version" : "1.0.0",
- "properties" : {
- "type" : {
- "required" : true,
- "type" : "string",
- "constraints" : [ {
- "valid_values" : [ "SQL", "PLSQL" ]
- } ]
- },
- "query" : {
- "required" : true,
- "type" : "string"
- },
- "input-key-mapping" : {
- "required" : false,
- "type" : "map",
- "entry_schema" : {
- "type" : "string"
- }
- },
- "output-key-mapping" : {
- "required" : false,
- "type" : "map",
- "entry_schema" : {
- "type" : "string"
- }
- },
- "key-dependencies" : {
- "required" : true,
- "type" : "list",
- "entry_schema" : {
- "type" : "string"
- }
- }
- },
- "derived_from" : "tosca.nodes.ResourceSource"
- },
- "vnf-netconf-device" : {
- "description" : "This is VNF Device with Netconf Capability",
- "version" : "1.0.0",
- "capabilities" : {
- "netconf" : {
- "type" : "tosca.capabilities.Netconf",
- "properties" : {
- "login-key" : {
- "required" : true,
- "type" : "string",
- "default" : "sdnc"
- },
- "login-account" : {
- "required" : true,
- "type" : "string",
- "default" : "sdnc-tacacs"
- },
- "source" : {
- "required" : true,
- "type" : "string",
- "default" : "npm"
- },
- "target-ip-address" : {
- "required" : true,
- "type" : "string"
- },
- "port-number" : {
- "required" : true,
- "type" : "integer",
- "default" : 830
- },
- "connection-time-out" : {
- "required" : false,
- "type" : "integer",
- "default" : 30
- }
- }
- }
- },
- "derived_from" : "tosca.nodes.Vnf"
- },
- "source-rest" : {
- "description" : "This is Rest Resource Source Node Type",
- "version" : "1.0.0",
- "properties" : {
- "type" : {
- "required" : false,
- "type" : "string",
- "constraints" : [ {
- "valid_values" : [ "JSON" ]
- } ],
- "default" : "JSON"
- },
- "url-path" : {
- "required" : true,
- "type" : "string"
- },
- "path" : {
- "required" : true,
- "type" : "string"
- },
- "expression-type" : {
- "required" : false,
- "type" : "string",
- "constraints" : [ {
- "valid_values" : [ "JSON_PATH", "JSON_POINTER" ]
- } ],
- "default" : "JSON_PATH"
- },
- "input-key-mapping" : {
- "required" : false,
- "type" : "map",
- "entry_schema" : {
- "type" : "string"
- }
- },
- "output-key-mapping" : {
- "required" : false,
- "type" : "map",
- "entry_schema" : {
- "type" : "string"
- }
- },
- "key-dependencies" : {
- "required" : true,
- "type" : "list",
- "entry_schema" : {
- "type" : "string"
- }
- }
- },
- "derived_from" : "tosca.nodes.ResourceSource"
- },
- "component-netconf-executor" : {
- "description" : "This is Netconf Transaction Configuration Component API",
- "version" : "1.0.0",
- "capabilities" : {
- "component-node" : {
- "type" : "tosca.capabilities.Node"
- }
- },
- "requirements" : {
- "netconf-connection" : {
- "capability" : "netconf",
- "node" : "vnf-netconf-device",
- "relationship" : "tosca.relationships.ConnectsTo"
- }
- },
- "interfaces" : {
- "NetconfExecutorComponent" : {
- "operations" : {
- "process" : {
- "inputs" : {
- "request-id" : {
- "description" : "Request Id used to store the generated configuration, in the database along with the template-name",
- "required" : true,
- "type" : "string"
- },
- "template-name" : {
- "description" : "Service Template Name",
- "required" : true,
- "type" : "string"
- },
- "template-version" : {
- "description" : "Service Template Version",
- "required" : true,
- "type" : "string"
- },
- "action-name" : {
- "description" : "Action Name to get from Database, Either (message & mask-info ) or ( resource-id & resource-type & action-name & template-name ) should be present. Message will be given higest priority",
- "required" : false,
- "type" : "string"
- },
- "resource-type" : {
- "description" : "Resource Type to get from Database, Either (message & mask-info ) or( resource-id & resource-type & action-name & template-name ) should be present. Message will be given higest priority",
- "required" : false,
- "type" : "string"
- },
- "resource-id" : {
- "description" : "Resource Id to get from Database, Either (message & mask-info ) or ( resource-id & resource-type & action-name & template-name ) should be present. Message will be given higest priority",
- "required" : false,
- "type" : "string"
- },
- "reservation-id" : {
- "description" : "Reservation Id used to send to NPM",
- "required" : false,
- "type" : "string"
- },
- "execution-script" : {
- "description" : "Python Script to Execute for this Component action, It should refer any one of Prython Artifact Definition for this Node Template.",
- "required" : true,
- "type" : "string"
- }
- },
- "outputs" : {
- "response-data" : {
- "description" : "Execution Response Data in JSON format.",
- "required" : false,
- "type" : "string"
- },
- "status" : {
- "description" : "Status of the Component Execution ( success or failure )",
- "required" : true,
- "type" : "string"
- }
- }
- }
- }
- }
- },
- "derived_from" : "tosca.nodes.component.Jython"
- }
},
"topology_template" : {
"inputs" : {