Add Blueprint Dervied from NodeType, Requirement Definitions and Assignments validations.
Change-Id: I1cc643b5a83c5a707c8e3ae1342a439f122da55e
Issue-ID: CCSDK-484
Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
"metadata": {\r
"template_author": "Brinda Santh Muthuramalingam",\r
"author-email": "brindasanth@gmail.com",\r
- "user-groups" : "ADMIN, OPERATION",\r
+ "user-groups": "ADMIN, OPERATION",\r
"template_name": "baseconfiguration",\r
"template_version": "1.0.0",\r
"template_tags": "brinda, tosca"\r
"hostname": {\r
"required": true,\r
"type": "string"\r
+ },\r
+ "template_name": {\r
+ "required": true,\r
+ "type": "string"\r
+ },\r
+ "template_version": {\r
+ "required": true,\r
+ "type": "string"\r
}\r
},\r
"node_templates": {\r
- "activate-process": {\r
- "type": "bpmn-activate",\r
- "properties": {\r
- "process-name": { "get_input" : "action-name" },\r
- "version" : { "get_property" : ["SELF", "process-name"] },\r
- "content": { "get_artifact" : ["SELF", "activate-process"] }\r
- },\r
- "artifacts": {\r
- "activate-process": {\r
- "type": "artifact-bpmn-camunda",\r
- "file": "Plans/ActivateProcess.bpmn"\r
- }\r
- }\r
- },\r
- "resource-assignment": {\r
- "type": "component-resource-assignment",\r
- "properties":{\r
- "request-id": "1234"\r
+ "resource-assignment-ra-component": {\r
+ "capabilities": {\r
+ "component-node": {}\r
},\r
"interfaces": {\r
- "DefaultComponentNode": {\r
+ "org-onap-sdnc-config-assignment-service-ConfigAssignmentNode": {\r
"operations": {\r
"process": {\r
"inputs": {\r
- "action-name": { "get_input" : "action-name" },\r
+ "template-names": [\r
+ "base-config-template",\r
+ "licence-template"\r
+ ],\r
+ "action-name": {\r
+ "get_input": "action-name"\r
+ },\r
+ "template-name": {\r
+ "get_input": "template_name"\r
+ },\r
+ "template-version": {\r
+ "get_input": "template_version"\r
+ },\r
"resource-type": "vnf-type",\r
- "request-id": { "get_input" : "request-id" },\r
- "resource-id": { "get_input" : "hostname" },\r
- "template-content": { "get_artifact" : ["SELF", "baseconfig-template"] },\r
- "mapping-content": { "get_artifact" : ["SELF", "baseconfig-mapping"] }\r
+ "request-id": {\r
+ "get_input": "request-id"\r
+ },\r
+ "resource-id": {\r
+ "get_input": "hostname"\r
+ }\r
},\r
"outputs": {\r
- "resource-assignment-params": "",\r
- "status": ""\r
+ "resource-assignment-params": "success",\r
+ "status": "status"\r
}\r
}\r
}\r
}\r
},\r
- "artifacts": {\r
- "baseconfig-template": {\r
- "type": "artifact-template-velocity",\r
- "file": "Templates/baseconfig-template.vtl"\r
+ "type": "component-resource-assignment"\r
+ },\r
+ "resource-assignment-action": {\r
+ "properties": {\r
+ "mode": "sync",\r
+ "version": {\r
+ "get_input": "template_version"\r
},\r
- "baseconfig-mapping": {\r
- "type": "artifact-mapping-resource",\r
- "file": "Mappings/baseconfig-mapping.json"\r
+ "is-start-flow": false\r
+ },\r
+ "requirements": {\r
+ "component-dependency": {\r
+ "capability": "component-node",\r
+ "node": "resource-assignment-ra-component",\r
+ "relationship": "tosca.relationships.DependsOn"\r
+ }\r
+ },\r
+ "capabilities": {\r
+ "dg-node": {},\r
+ "content": {\r
+ "properties": {\r
+ "type": "json"\r
+ }\r
}\r
- }\r
- },\r
- "resource-assignment-py": {\r
- "type": "component-resource-assignment",\r
- "properties":{\r
- "request-id": "1234"\r
},\r
"interfaces": {\r
- "DefaultComponentNode": {\r
+ "CONFIG": {\r
"operations": {\r
- "process": {\r
- "implementation" :{\r
- "primary" : "component-script"\r
- },\r
+ "ResourceAssignment": {\r
"inputs": {\r
- "action-name": { "get_input" : "action-name" }\r
- },\r
- "outputs": {\r
- "resource-assignment-params": "",\r
- "status": ""\r
+ "params": []\r
}\r
}\r
}\r
}\r
},\r
- "artifacts": {\r
- "component-script": {\r
- "type": "artifact-script-python",\r
- "file": "Scripts/baseconfig-template.vtl"\r
- }\r
- }\r
+ "type": "dg-resource-assignment"\r
}\r
},\r
- "workflows":{\r
- "activate-process":{\r
- "steps" : {\r
- "call-resource-assignment" : {\r
- "description" : "Invoke Resource Assignment Component",\r
- "target" : "resource-assignment",\r
- "activities" : [\r
- {\r
- "call_operation": "ResourceAssignmentNode.process"\r
- }\r
- ],\r
- "on_success" : [\r
- "download-baseconfig"\r
- ]\r
- },\r
- "download-baseconfig" : {\r
- "description" : "Call Download Base Config Component",\r
- "target" : "activate-netconf",\r
- "activities" : [\r
+ "workflows": {\r
+ "activate-process": {\r
+ "steps": {\r
+ "call-resource-assignment": {\r
+ "description": "Invoke Resource Assignment Component",\r
+ "target": "resource-assignment",\r
+ "activities": [\r
+ {\r
+ "call_operation": "ResourceAssignmentNode.process"\r
+ }\r
+ ],\r
+ "on_success": [\r
+ "download-baseconfig"\r
+ ]\r
+ },\r
+ "download-baseconfig": {\r
+ "description": "Call Download Base Config Component",\r
+ "target": "activate-netconf",\r
+ "activities": [\r
{\r
"call_operation": "NetconfTransactionNode.process"\r
}\r
],\r
- "on_success" : [\r
+ "on_success": [\r
"download-licence"\r
]\r
},\r
- "download-licence" : {\r
- "description" : "Call Download Licence Component",\r
- "target" : "activate-netconf",\r
- "activities" : [\r
+ "download-licence": {\r
+ "description": "Call Download Licence Component",\r
+ "target": "activate-netconf",\r
+ "activities": [\r
{\r
"call_operation": "NetconfTransactionNode.process"\r
}\r
}\r
},\r
"node_types": {\r
- "bpmn-activate": {\r
- "description": "This is BPMN Activate node type",\r
+ "dg-resource-assignment": {\r
+ "description": "This is Resource Assignment Directed Graph",\r
"version": "1.0.0",\r
"properties": {\r
- "content": {\r
+ "mode": {\r
"required": false,\r
- "type": "string"\r
- },\r
- "process-name": {\r
- "required": false,\r
- "type": "string"\r
+ "type": "string",\r
+ "default": "sync"\r
},\r
"version": {\r
"required": false,\r
"type": "string",\r
- "default" : "LATEST"\r
+ "default": "LATEST"\r
+ },\r
+ "is-start-flow": {\r
+ "required": false,\r
+ "type": "boolean",\r
+ "default": false\r
}\r
},\r
- "derived_from": "tosca.nodes.Component"\r
- },\r
- "tosca.nodes.Component": {\r
- "description": "This is Resource Assignment Component API",\r
- "version": "1.0.0",\r
- "properties": {\r
- "type": {\r
- "description": "Request Id used to store the generated configuration, in the database along with the template-name",\r
- "required": false,\r
- "type": "string"\r
+ "capabilities": {\r
+ "dg-node": {\r
+ "type": "tosca.capabilities.Node"\r
+ },\r
+ "content": {\r
+ "type": "tosca.capability.Content",\r
+ "properties": {\r
+ "type": {\r
+ "required": false,\r
+ "type": "string",\r
+ "default": "json"\r
+ },\r
+ "content": {\r
+ "required": false,\r
+ "type": "string"\r
+ }\r
+ }\r
+ }\r
+ },\r
+ "requirements": {\r
+ "component-dependency": {\r
+ "capability": "component-node",\r
+ "node": "component-resource-assignment",\r
+ "relationship": "tosca.relationships.DependsOn"\r
}\r
},\r
"interfaces": {\r
- "DefaultOperation": {\r
+ "CONFIG": {\r
"operations": {\r
- "validate": {\r
+ "ResourceAssignment": {\r
"inputs": {\r
- "action-name": {\r
- "description": "validate for action",\r
+ "params": {\r
"required": false,\r
- "type": "string"\r
+ "type": "list",\r
+ "entry_schema": {\r
+ "type": "datatype-property"\r
+ }\r
}\r
}\r
}\r
}\r
}\r
},\r
- "artifacts" :{\r
- "component-jar": {\r
- "description": "Component Jar",\r
- "type": "artifact-component-jar",\r
- "file": "Component/basecomponent.jar"\r
- }\r
- },\r
- "derived_from": "tosca.nodes.Root"\r
- },\r
- "tosca.nodes.component.Python": {\r
- "description": "This is Resource Assignment Python Component API",\r
- "version": "1.0.0",\r
- "derived_from": "tosca.nodes.Root"\r
+ "derived_from": "tosca.nodes.DG"\r
},\r
"component-resource-assignment": {\r
"description": "This is Resource Assignment Component API",\r
"version": "1.0.0",\r
- "properties": {\r
- "request-id": {\r
- "description": "Request Id used to store the generated configuration, in the database along with the template-name",\r
- "required": true,\r
- "type": "string"\r
+ "capabilities": {\r
+ "component-node": {\r
+ "type": "tosca.capabilities.Node"\r
}\r
},\r
"interfaces": {\r
- "DefaultComponentNode": {\r
+ "org-onap-sdnc-config-assignment-service-ConfigAssignmentNode": {\r
"operations": {\r
"process": {\r
"inputs": {\r
"action-name": {\r
- "description": "Recipe 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",\r
- "required": false,\r
+ "description": "Action Name of the process",\r
+ "required": true,\r
"type": "string"\r
},\r
- "resource-type": {\r
- "required": false,\r
+ "template-name": {\r
+ "description": "Service Template Name.",\r
+ "required": true,\r
"type": "string"\r
},\r
- "request-id": {\r
- "description": "Request Id used to store the generated configuration, in the database along with the template-name",\r
+ "template-version": {\r
+ "description": "Service Template Version.",\r
"required": true,\r
"type": "string"\r
},\r
- "resource-id": {\r
- "description": "Id used to pull the data content from the data base. Either template-data or resource-id should be present",\r
+ "resource-type": {\r
+ "description": "Request type.",\r
"required": true,\r
"type": "string"\r
},\r
- "template-content": {\r
- "description": "Id used to pull the data content from the data base. Either template-data or resource-id should be present",\r
+ "template-names": {\r
+ "description": "Name of the artifact Node Templates, to get the template Content.",\r
+ "required": true,\r
+ "type": "list",\r
+ "entry_schema": {\r
+ "type": "string"\r
+ }\r
+ },\r
+ "request-id": {\r
+ "description": "Request Id, Unique Id for the request.",\r
"required": true,\r
"type": "string"\r
},\r
- "mapping-content": {\r
- "description": "Id used to pull the data content from the data base. Either template-data or resource-id should be present",\r
+ "resource-id": {\r
+ "description": "Resource Id.",\r
"required": true,\r
"type": "string"\r
}\r
},\r
"derived_from": "tosca.nodes.Component"\r
},\r
- "component-resource-assignment-python": {\r
+ "tosca.nodes.DG": {\r
+ "description": "This is Resource Assignment Component API",\r
+ "version": "1.0.0",\r
+ "derived_from": "tosca.nodes.Root"\r
+ },\r
+ "tosca.nodes.Component": {\r
"description": "This is Resource Assignment Component API",\r
"version": "1.0.0",\r
+ "derived_from": "tosca.nodes.Root"\r
+ },\r
+ "tosca.nodes.component.Python": {\r
+ "description": "This is Resource Assignment Python Component API",\r
+ "version": "1.0.0",\r
+ "derived_from": "tosca.nodes.Root"\r
+ }\r
+ },\r
+ "data_types": {\r
+ "datatype-resource-assignment": {\r
+ "version": "1.0.0",\r
+ "description": "This is Resource Assignment Data Type",\r
"properties": {\r
- "request-id": {\r
- "description": "Request Id used to store the generated configuration, in the database along with the template-name",\r
+ "property": {\r
"required": true,\r
+ "type": "datatype-property"\r
+ },\r
+ "input-param": {\r
+ "required": true,\r
+ "type": "boolean"\r
+ },\r
+ "dictionary-name": {\r
+ "required": false,\r
"type": "string"\r
- }\r
- },\r
- "interfaces": {\r
- "DefaultComponentNode": {\r
- "operations": {\r
- "process": {\r
- "inputs": {\r
- "action-name": {\r
- "description": "Recipe 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",\r
- "required": false,\r
- "type": "string"\r
- }\r
- },\r
- "outputs": {\r
- "resource-assignment-params": {\r
- "required": true,\r
- "type": "string"\r
- },\r
- "status": {\r
- "required": true,\r
- "type": "string"\r
- }\r
- }\r
- }\r
+ },\r
+ "dictionary-source": {\r
+ "required": false,\r
+ "type": "string"\r
+ },\r
+ "dependencies": {\r
+ "required": true,\r
+ "type": "list",\r
+ "entry_schema": {\r
+ "type": "string"\r
}\r
+ },\r
+ "status": {\r
+ "required": false,\r
+ "type": "string"\r
+ },\r
+ "message": {\r
+ "required": false,\r
+ "type": "string"\r
+ },\r
+ "updated-date": {\r
+ "required": false,\r
+ "type": "string"\r
+ },\r
+ "updated-by": {\r
+ "required": false,\r
+ "type": "string"\r
}\r
},\r
- "derived_from": "tosca.nodes.component.Python"\r
- }\r
- },\r
- "data_types": {\r
- "sample-property" : {\r
- "description": "This is sample data type",\r
+ "derived_from": "tosca.datatypes.Root"\r
+ },\r
+ "datatype-property": {\r
"version": "1.0.0",\r
+ "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",\r
"properties": {\r
- "content": {\r
+ "type": {\r
+ "required": true,\r
+ "type": "string"\r
+ },\r
+ "description": {\r
"required": false,\r
"type": "string"\r
},\r
- "process-name": {\r
+ "required": {\r
+ "required": false,\r
+ "type": "boolean"\r
+ },\r
+ "default": {\r
"required": false,\r
"type": "string"\r
},\r
- "version": {\r
+ "entry_schema": {\r
"required": false,\r
- "type": "string",\r
- "default" : "LATEST"\r
+ "type": "string"\r
}\r
},\r
- "derived_from" : "tosca.datatypes.Root"\r
+ "derived_from": "tosca.datatypes.Root"\r
}\r
}\r
}
\ No newline at end of file
--- /dev/null
+{\r
+ "description": "This is Deprecated Artifact Node Type.",\r
+ "version": "1.0.0",\r
+ "derived_from": "tosca.nodes.Root"\r
+}
\ No newline at end of file
BluePrintConstants.MODEL_TYPE_DATA_TYPE_DYNAMIC\r
)\r
\r
+ @JvmStatic\r
+ val validRelationShipDerivedFroms: MutableList<String> = arrayListOf(\r
+ BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_ROOT,\r
+ BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_DEPENDS_ON,\r
+ BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_HOSTED_ON,\r
+ BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO,\r
+ BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_ATTACH_TO,\r
+ BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_ROUTES_TO\r
+ )\r
+\r
@JvmStatic\r
fun validModelTypes(): List<String> {\r
val validTypes: MutableList<String> = arrayListOf()\r
\r
@Throws(BluePrintException::class)\r
override fun enrichNodeType(nodeTypeName: String, nodeType: NodeType) {\r
+ log.debug("Enriching NodeType({})", nodeTypeName)\r
+ val derivedFrom = nodeType.derivedFrom\r
+\r
+ if (!BluePrintTypes.rootNodeTypes().contains(derivedFrom)) {\r
+ val derivedFromNodeType = populateNodeType(nodeTypeName)\r
+ // Enrich NodeType\r
+ enrichNodeType(derivedFrom, derivedFromNodeType)\r
+ }\r
\r
// NodeType Property Definitions\r
enrichNodeTypeProperties(nodeTypeName, nodeType)\r
open fun enrichNodeTypeInterfaces(nodeTypeName: String, nodeType: NodeType) {\r
nodeType.interfaces?.forEach { interfaceName, interfaceObj ->\r
// Populate Node type Interface Operation\r
- log.info("*** ** Enriching NodeType: {} Interface {}", nodeTypeName, interfaceName)\r
+ log.debug("Enriching NodeType({}) Interface({})", nodeTypeName, interfaceName)\r
populateNodeTypeInterfaceOperation(nodeTypeName, interfaceName, interfaceObj)\r
\r
}\r
}\r
\r
open fun populateNodeType(nodeTypeName: String): NodeType {\r
- val nodeType = bluePrintRepoService.getNodeType(nodeTypeName)?.block()\r
+\r
+ val nodeType = serviceTemplate.nodeTypes?.get(nodeTypeName)\r
+ ?: bluePrintRepoService.getNodeType(nodeTypeName)?.block()\r
?: throw BluePrintException(format("Couldn't get NodeType({}) from repo.", nodeTypeName))\r
serviceTemplate.nodeTypes?.put(nodeTypeName, nodeType)\r
return nodeType\r
}\r
\r
open fun populateArtifactType(artifactTypeName: String): ArtifactType {\r
- val artifactType = bluePrintRepoService.getArtifactType(artifactTypeName)?.block()\r
+ val artifactType = serviceTemplate.artifactTypes?.get(artifactTypeName)\r
+ ?: bluePrintRepoService.getArtifactType(artifactTypeName)?.block()\r
?: throw BluePrintException(format("Couldn't get ArtifactType({}) from repo.", artifactTypeName))\r
serviceTemplate.artifactTypes?.put(artifactTypeName, artifactType)\r
return artifactType\r
}\r
\r
open fun populateDataTypes(dataTypeName: String): DataType {\r
- val dataType = bluePrintRepoService.getDataType(dataTypeName)?.block()\r
+ val dataType = serviceTemplate.dataTypes?.get(dataTypeName)\r
+ ?: bluePrintRepoService.getDataType(dataTypeName)?.block()\r
?: throw BluePrintException(format("Couldn't get DataType({}) from repo.", dataTypeName))\r
serviceTemplate.dataTypes?.put(dataTypeName, dataType)\r
return dataType\r
paths.add("dataTypes")\r
dataTypes.forEach { dataTypeName, dataType ->\r
paths.add(dataTypeName)\r
- message.appendln("--> Data Type :" + paths.joinToString(separator))\r
+ message.appendln("--> DataType :" + paths.joinToString(separator))\r
dataType.properties?.let { validatePropertyDefinitions(dataType.properties!!) }\r
paths.removeAt(paths.lastIndex)\r
}\r
//Check Derived From\r
checkValidNodeTypesDerivedFrom(nodeTypeName, derivedFrom)\r
\r
+ if(!BluePrintTypes.rootNodeTypes().contains(derivedFrom)){\r
+ serviceTemplate.nodeTypes?.get(derivedFrom)\r
+ ?: throw BluePrintException(format("Failed to get derivedFrom NodeType({})'s for NodeType({}) ",\r
+ derivedFrom, nodeTypeName))\r
+ }\r
+\r
nodeType.properties?.let { validatePropertyDefinitions(nodeType.properties!!) }\r
+ nodeType.requirements?.let { validateRequirementDefinitions(nodeTypeName, nodeType) }\r
nodeType.interfaces?.let { validateInterfaceDefinitions(nodeType.interfaces!!) }\r
paths.removeAt(paths.lastIndex)\r
}\r
@Throws(BluePrintException::class)\r
open fun checkValidNodeTypesDerivedFrom(nodeTypeName: String, derivedFrom: String) {\r
check(BluePrintTypes.validNodeTypeDerivedFroms.contains(derivedFrom)) {\r
- throw BluePrintException(format("Failed to get node type ({})'s derived from({}) definition ", nodeTypeName, derivedFrom))\r
+ throw BluePrintException(format("Failed to get node type ({})'s derivedFrom({}) definition ", nodeTypeName, derivedFrom))\r
}\r
}\r
\r
@Throws(BluePrintException::class)\r
open fun validateNodeTemplate(nodeTemplateName: String, nodeTemplate: NodeTemplate) {\r
paths.add(nodeTemplateName)\r
- message.appendln("---> Node Template :" + paths.joinToString(separator))\r
+ message.appendln("---> NodeTemplate :" + paths.joinToString(separator))\r
val type: String = nodeTemplate.type\r
\r
val nodeType: NodeType = serviceTemplate.nodeTypes?.get(type)\r
- ?: throw BluePrintException(format("Failed to get node type definition for node template : {}", nodeTemplateName))\r
+ ?: throw BluePrintException(format("Failed to get NodeType({}) definition for NodeTemplate({})", type, nodeTemplateName))\r
\r
nodeTemplate.artifacts?.let { validateArtifactDefinitions(nodeTemplate.artifacts!!) }\r
nodeTemplate.properties?.let { validatePropertyAssignments(nodeType.properties!!, nodeTemplate.properties!!) }\r
nodeTemplate.capabilities?.let { validateCapabilityAssignments(nodeTemplate.capabilities!!) }\r
- nodeTemplate.requirements?.let { validateRequirementAssignments(nodeTemplate.requirements!!) }\r
+ nodeTemplate.requirements?.let { validateRequirementAssignments(nodeType, nodeTemplateName, nodeTemplate) }\r
nodeTemplate.interfaces?.let { validateInterfaceAssignments(nodeType, nodeTemplateName, nodeTemplate) }\r
paths.removeAt(paths.lastIndex)\r
}\r
paths.add(artifactDefinitionName)\r
message.appendln("Validating artifact " + paths.joinToString(separator))\r
val type: String = artifactDefinition.type\r
- ?: throw BluePrintException("type is missing for artifact definition :" + artifactDefinitionName)\r
+ ?: throw BluePrintException(format("type is missing for ArtifactDefinition({})", artifactDefinitionName))\r
// Check Artifact Type\r
checkValidArtifactType(artifactDefinitionName, type)\r
\r
val file: String = artifactDefinition.file\r
- ?: throw BluePrintException(format("file is missing for artifact definition : {}", artifactDefinitionName))\r
+ ?: throw BluePrintException(format("file is missing for ArtifactDefinition({})", artifactDefinitionName))\r
\r
paths.removeAt(paths.lastIndex)\r
}\r
}\r
BluePrintTypes.validCollectionTypes().contains(dataType) -> {\r
val entrySchemaType: String = propertyDefinition.entrySchema?.type\r
- ?: throw BluePrintException(format("Entry schema for data type ({}) for the property ({}) not found", dataType, propertyName))\r
+ ?: throw BluePrintException(format("Entry schema for DataType ({}) for the property ({}) not found", dataType, propertyName))\r
checkPrimitiveOrComplex(entrySchemaType, propertyName)\r
}\r
else -> checkPropertyDataType(dataType, propertyName)\r
}\r
\r
@Throws(BluePrintException::class)\r
- open fun validateRequirementAssignments(requirements: MutableMap<String, RequirementAssignment>) {\r
+ open fun validateRequirementAssignments(nodeType: NodeType, nodeTemplateName: String, nodeTemplate: NodeTemplate) {\r
+ val requirements = nodeTemplate.requirements\r
+ paths.add("requirements")\r
+ requirements?.forEach { requirementName, requirementAssignment ->\r
+ paths.add(requirementName)\r
+ val requirementDefinition = nodeType.requirements?.get(requirementName)\r
+ ?: throw BluePrintException(format("Failed to get NodeTemplate({}) requirement definition ({}) from" +\r
+ " NodeType({}) ", nodeTemplateName, requirementName, nodeTemplate.type))\r
+ // Validate Requirement Assignment\r
+ validateRequirementAssignment(nodeTemplateName, requirementName, requirementDefinition, requirementAssignment)\r
+ paths.removeAt(paths.lastIndex)\r
+ }\r
+ paths.removeAt(paths.lastIndex)\r
+\r
+ }\r
+\r
+ @Throws(BluePrintException::class)\r
+ open fun validateRequirementAssignment(nodeTemplateName: String, requirementAssignmentName: String,\r
+ requirementDefinition: RequirementDefinition, requirementAssignment: RequirementAssignment) {\r
+ log.info("Validating NodeTemplate({}) requirement assignment ({}) ", nodeTemplateName, requirementAssignmentName)\r
+ val requirementNodeTemplateName = requirementAssignment.node!!\r
+ val capabilityName = requirementAssignment.capability\r
+ val relationship = requirementAssignment.relationship!!\r
+\r
+ check(BluePrintTypes.validRelationShipDerivedFroms.contains(relationship)) {\r
+ throw BluePrintException(format("Failed to get relationship type ({}) for NodeTemplate({})'s requirement({}) ",\r
+ relationship, nodeTemplateName, requirementAssignmentName))\r
+ }\r
+\r
+ val relationShipNodeTemplate = serviceTemplate.topologyTemplate?.nodeTemplates?.get(requirementNodeTemplateName)\r
+ ?: throw BluePrintException(format("Failed to get requirement NodeTemplate({})'s for NodeTemplate({}) requirement({}) ",\r
+ requirementNodeTemplateName, nodeTemplateName, requirementAssignmentName))\r
+\r
+ relationShipNodeTemplate.capabilities?.get(capabilityName)\r
+ ?: throw BluePrintException(format("Failed to get requirement NodeTemplate({})'s capability({}) for NodeTemplate ({})'s requirement({}) ",\r
+ requirementNodeTemplateName, capabilityName, nodeTemplateName, requirementAssignmentName))\r
+\r
\r
}\r
\r
interfaces?.forEach { interfaceAssignmentName, interfaceAssignment ->\r
paths.add(interfaceAssignmentName)\r
val interfaceDefinition = nodeType.interfaces?.get(interfaceAssignmentName)\r
- ?: throw BluePrintException(format("Failed to get nodeTemplate({}) interface definition ({}) from" +\r
- " node type ({}) ", nodeTemplateName, interfaceAssignmentName, nodeTemplate.type))\r
+ ?: throw BluePrintException(format("Failed to get NodeTemplate({}) interface definition ({}) from" +\r
+ " NodeType({}) ", nodeTemplateName, interfaceAssignmentName, nodeTemplate.type))\r
\r
validateInterfaceAssignment(nodeTemplateName, interfaceAssignmentName, interfaceDefinition,\r
interfaceAssignment)\r
it.forEach { operationAssignmentName, operationAssignments ->\r
\r
val operationDefinition = interfaceDefinition.operations?.get(operationAssignmentName)\r
- ?: throw BluePrintException(format("Failed to get nodeTemplate({}) operation definition ({}) ",\r
+ ?: throw BluePrintException(format("Failed to get NodeTemplate({}) operation definition ({}) ",\r
nodeTemplateName, operationAssignmentName))\r
\r
- log.info("Validation Node Template({}) Interface({}) Operation ({})", nodeTemplateName,\r
+ log.info("Validation NodeTemplate({}) Interface({}) Operation ({})", nodeTemplateName,\r
interfaceAssignmentName, operationAssignmentName)\r
\r
val inputs = operationAssignments.inputs\r
\r
inputs?.forEach { propertyName, propertyAssignment ->\r
val propertyDefinition = operationDefinition.inputs?.get(propertyName)\r
- ?: throw BluePrintException(format("Failed to get nodeTemplate({}) operation definition ({}) " +\r
+ ?: throw BluePrintException(format("Failed to get NodeTemplate({}) operation definition ({}) " +\r
"property definition({})", nodeTemplateName, operationAssignmentName, propertyName))\r
// Check the property values with property definition\r
validatePropertyAssignment(propertyName, propertyDefinition, propertyAssignment)\r
\r
}\r
\r
+ @Throws(BluePrintException::class)\r
+ open fun validateRequirementDefinitions(nodeName: String, nodeType: NodeType) {\r
+ paths.add("requirements")\r
+ val requirements = nodeType.requirements\r
+\r
+ requirements?.forEach { requirementDefinitionName, requirementDefinition ->\r
+ paths.add(requirementDefinitionName)\r
+ message.appendln("Validating : " + paths.joinToString(separator))\r
+ validateRequirementDefinition(nodeName, nodeType, requirementDefinitionName, requirementDefinition)\r
+ paths.removeAt(paths.lastIndex)\r
+ }\r
+ paths.removeAt(paths.lastIndex)\r
+ }\r
+\r
+ @Throws(BluePrintException::class)\r
+ open fun validateRequirementDefinition(nodeTypeName: String, nodeType: NodeType, requirementDefinitionName: String,\r
+ requirementDefinition: RequirementDefinition) {\r
+\r
+ log.info("Validating NodeType({}) RequirementDefinition ({}) ", nodeTypeName, requirementDefinitionName)\r
+ val requirementNodeTypeName = requirementDefinition.node!!\r
+ val capabilityName = requirementDefinition.capability\r
+ val relationship = requirementDefinition.relationship!!\r
+\r
+ check(BluePrintTypes.validRelationShipDerivedFroms.contains(relationship)) {\r
+ throw BluePrintException(format("Failed to get relationship({}) for NodeType({})'s requirement({}) ",\r
+ relationship, nodeTypeName, requirementDefinitionName))\r
+ }\r
+\r
+ val relationShipNodeType = serviceTemplate.nodeTypes?.get(requirementNodeTypeName)\r
+ ?: throw BluePrintException(format("Failed to get requirement NodeType({})'s for requirement({}) ",\r
+ requirementNodeTypeName, requirementDefinitionName))\r
+\r
+ relationShipNodeType.capabilities?.get(capabilityName)\r
+ ?: throw BluePrintException(format("Failed to get requirement NodeType({})'s capability({}) for NodeType ({})'s requirement({}) ",\r
+ requirementNodeTypeName, capabilityName, nodeTypeName, requirementDefinitionName))\r
+\r
+ }\r
+\r
\r
@Throws(BluePrintException::class)\r
open fun validateInterfaceDefinitions(interfaces: MutableMap<String, InterfaceDefinition>) {\r
open fun checkValidArtifactType(artifactDefinitionName: String, artifactTypeName: String) {\r
\r
val artifactType = serviceTemplate.artifactTypes?.get(artifactTypeName)\r
- ?: throw BluePrintException(format("Failed to artifact type for artifact definition : {}", artifactDefinitionName))\r
+ ?: throw BluePrintException(format("Failed to ArtifactType for ArtifactDefinition : {}", artifactDefinitionName))\r
\r
checkValidArtifactTypeDerivedFrom(artifactTypeName, artifactType.derivedFrom)\r
}\r
@Throws(BluePrintException::class)\r
open fun checkValidArtifactTypeDerivedFrom(artifactTypeName: String, derivedFrom: String) {\r
check(BluePrintTypes.validArtifactTypeDerivedFroms.contains(derivedFrom)) {\r
- throw BluePrintException(format("Failed to get artifact type ({})'s derived from({}) definition ", artifactTypeName, derivedFrom))\r
+ throw BluePrintException(format("Failed to get ArtifactType ({})'s derivedFrom({}) definition ", artifactTypeName, derivedFrom))\r
}\r
}\r
\r
@Throws(BluePrintException::class)\r
open fun checkValidDataTypeDerivedFrom(dataTypeName: String, derivedFrom: String) {\r
check(BluePrintTypes.validDataTypeDerivedFroms.contains(derivedFrom)) {\r
- throw BluePrintException(format("Failed to get data type ({})'s derived from({}) definition ", dataTypeName, derivedFrom))\r
+ throw BluePrintException(format("Failed to get DataType ({})'s derivedFrom({}) definition ", dataTypeName, derivedFrom))\r
+ }\r
+ }\r
+\r
+ @Throws(BluePrintException::class)\r
+ open fun checkValidRelationshipTypeDerivedFrom(relationshipTypeName: String, derivedFrom: String) {\r
+ check(BluePrintTypes.validRelationShipDerivedFroms.contains(derivedFrom)) {\r
+ throw BluePrintException(format("Failed to get relationship type ({})'s derivedFrom({}) definition ", relationshipTypeName, derivedFrom))\r
}\r
}\r
\r
} else if (BluePrintTypes.validCollectionTypes().contains(propertyType)) {\r
\r
val entrySchemaType = propertyDefinition.entrySchema?.type\r
- ?: throw BluePrintException(format("Failed to get Entry Schema type for the collection property ({})", propertyName))\r
+ ?: throw BluePrintException(format("Failed to get EntrySchema type for the collection property ({})", propertyName))\r
\r
if (!BluePrintTypes.validPropertyTypes().contains(entrySchemaType)) {\r
checkPropertyDataType(entrySchemaType, propertyName)\r
}\r
\r
check(isValid) {\r
- throw BluePrintException(format("property({}) defined of type({}) is not compatable with the value ({})",\r
+ throw BluePrintException(format("property({}) defined of type({}) is not comptable with the value ({})",\r
propertyName, propertyType, propertyAssignment))\r
}\r
}\r
private fun checkPropertyDataType(dataType: String, propertyName: String) {\r
\r
val dataType = serviceTemplate.dataTypes?.get(dataType)\r
- ?: throw BluePrintException(format("Data type ({}) for the property ({}) not found", dataType, propertyName))\r
+ ?: throw BluePrintException(format("DataType ({}) for the property ({}) not found", dataType, propertyName))\r
\r
checkValidDataTypeDerivedFrom(propertyName, dataType.derivedFrom)\r
\r
if (BluePrintTypes.validPrimitiveTypes().contains(dataType) || checkDataType(dataType)) {\r
return true\r
} else {\r
- throw BluePrintException(format("Data type ({}) for the property ({}) is not valid", dataType))\r
+ throw BluePrintException(format("DataType ({}) for the property ({}) is not valid", dataType))\r
}\r
}\r
\r
context[BluePrintConstants.PROPERTY_BLUEPRINT_BASE_PATH] = basepath.plus("/simple-baseconfig")\r
val bluePrintRuntimeService = BluePrintRuntimeService(bluePrintContext, context)\r
\r
- val inputDataPath = "src/test/resources/data/default-context.json"\r
+ val inputDataPath = "src/test/resources/data/default-context.json"\r
\r
val inputNode: JsonNode = jsonNodeFromFile(inputDataPath)\r
bluePrintRuntimeService.assignInputs(inputNode)\r
\r
- val propContext: MutableMap<String, Any?> = bluePrintRuntimeService.resolveNodeTemplateProperties("activate-process")\r
- log.info("Context {}" ,bluePrintRuntimeService.context)\r
+ val propContext: MutableMap<String, Any?> = bluePrintRuntimeService.resolveNodeTemplateProperties("resource-assignment-action")\r
+ log.info("Context {}", bluePrintRuntimeService.context)\r
\r
assertNotNull(propContext, "Failed to populate interface property values")\r
- assertEquals(propContext.get("process-name"), jsonNodeFromObject("sample-action"), "Failed to populate parameter process-name")\r
- assertEquals(propContext.get("version"), jsonNodeFromObject("sample-action"), "Failed to populate parameter version")\r
+ assertEquals(propContext.get("mode"), jsonNodeFromObject("sync"), "Failed to populate parameter process-name")\r
+ assertEquals(propContext.get("version"), jsonNodeFromObject("1.0.0"), "Failed to populate parameter version")\r
}\r
\r
@Test\r
val context: MutableMap<String, Any> = hashMapOf()\r
context[BluePrintConstants.PROPERTY_BLUEPRINT_BASE_PATH] = basepath.plus("/simple-baseconfig")\r
\r
- val inputDataPath = "src/test/resources/data/default-context.json"\r
+ val inputDataPath = "src/test/resources/data/default-context.json"\r
BluePrintRuntimeUtils.assignInputsFromFile(bluePrintContext, inputDataPath, context)\r
\r
\r
val bluePrintRuntimeService = BluePrintRuntimeService(bluePrintContext, context)\r
\r
- log.info("Prepared Context {}" ,context)\r
+ log.info("Prepared Context {}", context)\r
\r
- val inContext: MutableMap<String, Any?> = bluePrintRuntimeService.resolveNodeTemplateInterfaceOperationInputs("resource-assignment",\r
- "DefaultComponentNode", "process")\r
+ val inContext: MutableMap<String, Any?> = bluePrintRuntimeService.resolveNodeTemplateInterfaceOperationInputs("resource-assignment-ra-component",\r
+ "org-onap-sdnc-config-assignment-service-ConfigAssignmentNode", "process")\r
\r
- log.trace("In Context {}" ,inContext)\r
+ log.info("In Context {}", inContext)\r
\r
assertNotNull(inContext, "Failed to populate interface input property values")\r
assertEquals(inContext.get("action-name"), jsonNodeFromObject("sample-action"), "Failed to populate parameter action-name")\r
assertEquals(inContext.get("request-id"), jsonNodeFromObject("12345"), "Failed to populate parameter action-name")\r
- assertEquals(inContext.get("template-content"), jsonNodeFromObject("This is Sample Velocity Template"), "Failed to populate parameter action-name")\r
-\r
}\r
\r
@Test\r
assertNotNull(bluePrintContext, "Failed to populate Blueprint context")\r
\r
val context: MutableMap<String, Any> = hashMapOf()\r
- context[BluePrintConstants.PROPERTY_BLUEPRINT_BASE_PATH] = basepath.plus("/simple-baseconfig")\r
+ context[BluePrintConstants.PROPERTY_BLUEPRINT_BASE_PATH] = basepath.plus("/simple-baseconfig")\r
\r
val bluePrintRuntimeService = BluePrintRuntimeService(bluePrintContext, context)\r
\r
val componentContext: MutableMap<String, Any?> = hashMapOf()\r
- val successValue : JsonNode= jsonNodeFromObject("Success")\r
- componentContext["resource-assignment.DefaultComponentNode.process.status"] = successValue\r
- componentContext["resource-assignment.DefaultComponentNode.process.resource-assignment-params"] = null\r
+ val successValue: JsonNode = jsonNodeFromObject("Success")\r
+ componentContext["resource-assignment-ra-component.org-onap-sdnc-config-assignment-service-ConfigAssignmentNode.process.status"] = successValue\r
+ componentContext["resource-assignment-ra-component.org-onap-sdnc-config-assignment-service-ConfigAssignmentNode.process.resource-assignment-params"] = null\r
\r
- bluePrintRuntimeService.resolveNodeTemplateInterfaceOperationOutputs("resource-assignment",\r
- "DefaultComponentNode", "process", componentContext)\r
+ bluePrintRuntimeService.resolveNodeTemplateInterfaceOperationOutputs("resource-assignment-ra-component",\r
+ "org-onap-sdnc-config-assignment-service-ConfigAssignmentNode", "process", componentContext)\r
\r
assertEquals(NullNode.instance,\r
- context.get("node_templates/resource-assignment/interfaces/DefaultComponentNode/operations/process/properties/resource-assignment-params"),\r
+ context.get("node_templates/resource-assignment-ra-component/interfaces/org-onap-sdnc-config-assignment-service-ConfigAssignmentNode/operations/process/properties/resource-assignment-params"),\r
"Failed to get operation property resource-assignment-params")\r
\r
assertEquals(successValue,\r
- context.get("node_templates/resource-assignment/interfaces/DefaultComponentNode/operations/process/properties/status"),\r
+ context.get("node_templates/resource-assignment-ra-component/interfaces/org-onap-sdnc-config-assignment-service-ConfigAssignmentNode/operations/process/properties/status"),\r
"Failed to get operation property status")\r
\r
\r
{\r
"request-id" : "12345",\r
"hostname" : "localhost",\r
+ "template_name": "baseconfiguration",\r
+ "template_version": "1.0.0",\r
"action-name" : "sample-action"\r
}
\ No newline at end of file
"default" : "LATEST"\r
}\r
},\r
- "derived_from": "tosca.nodes.Component"\r
+ "derived_from": "tosca.nodes.DG"\r
},\r
"tosca.nodes.Component": {\r
"description": "This is Resource Assignment Component API",\r
},\r
"derived_from": "tosca.nodes.Root"\r
},\r
+ "tosca.nodes.DG" : {\r
+ "description" : "This is Directed Graph Node Type",\r
+ "version" : "1.0.0",\r
+ "derived_from" : "tosca.nodes.Root"\r
+ },\r
"tosca.nodes.component.Python": {\r
"description": "This is Resource Assignment Python Component API",\r
"version": "1.0.0",\r
--- /dev/null
+{\r
+ "description": "This is Deprecated Artifact Node Type.",\r
+ "version": "1.0.0",\r
+ "derived_from": "tosca.nodes.Root"\r
+}
\ No newline at end of file
+++ /dev/null
-{\r
- "metadata": {\r
- "template_author": "Brinda Santh Muthuramalingam",\r
- "author-email": "brindasanth@gmail.com",\r
- "user-groups" : "ADMIN, OPERATION",\r
- "template_name": "baseconfiguration",\r
- "template_version": "1.0.0",\r
- "template_tags": "brinda, tosca"\r
- },\r
- "topology_template": {\r
- "inputs": {\r
- "request-id": {\r
- "required": true,\r
- "type": "string"\r
- },\r
- "action-name": {\r
- "required": true,\r
- "type": "string"\r
- },\r
- "scope-type": {\r
- "required": true,\r
- "type": "string"\r
- },\r
- "hostname": {\r
- "required": true,\r
- "type": "string"\r
- }\r
- },\r
- "node_templates": {\r
- "activate-process": {\r
- "type": "bpmn-activate",\r
- "properties": {\r
- "process-name": { "get_input" : "action-name" },\r
- "version" : { "get_property" : ["SELF", "process-name"] },\r
- "content": { "get_artifact" : ["SELF", "activate-process"] }\r
- },\r
- "artifacts": {\r
- "activate-process": {\r
- "type": "artifact-bpmn-camunda",\r
- "file": "Plans/ActivateProcess.bpmn"\r
- }\r
- }\r
- },\r
- "resource-assignment": {\r
- "type": "component-resource-assignment",\r
- "properties":{\r
- "request-id": "1234"\r
- },\r
- "interfaces": {\r
- "DefaultComponentNode": {\r
- "operations": {\r
- "process": {\r
- "inputs": {\r
- "action-name": { "get_input" : "action-name" },\r
- "resource-type": "vnf-type",\r
- "request-id": { "get_input" : "request-id" },\r
- "resource-id": { "get_input" : "hostname" },\r
- "template-content": { "get_artifact" : ["SELF", "baseconfig-template"] },\r
- "mapping-content": { "get_artifact" : ["SELF", "baseconfig-mapping"] }\r
- },\r
- "outputs": {\r
- "resource-assignment-params": "",\r
- "status": ""\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "artifacts": {\r
- "baseconfig-template": {\r
- "type": "artifact-template-velocity",\r
- "file": "Templates/baseconfig-template.vtl"\r
- },\r
- "baseconfig-mapping": {\r
- "type": "artifact-mapping-resource",\r
- "file": "Mappings/baseconfig-mapping.json"\r
- }\r
- }\r
- },\r
- "resource-assignment-py": {\r
- "type": "component-resource-assignment",\r
- "properties":{\r
- "request-id": "1234"\r
- },\r
- "interfaces": {\r
- "DefaultComponentNode": {\r
- "operations": {\r
- "process": {\r
- "implementation" :{\r
- "primary" : "component-script"\r
- },\r
- "inputs": {\r
- "action-name": { "get_input" : "action-name" }\r
- },\r
- "outputs": {\r
- "resource-assignment-params": "",\r
- "status": ""\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "artifacts": {\r
- "component-script": {\r
- "type": "artifact-script-python",\r
- "file": "Scripts/baseconfig-template.vtl"\r
- }\r
- }\r
- }\r
- },\r
- "workflows":{\r
- "activate-process":{\r
- "steps" : {\r
- "call-resource-assignment" : {\r
- "description" : "Invoke Resource Assignment Component",\r
- "target" : "resource-assignment",\r
- "activities" : [\r
- {\r
- "call_operation": "ResourceAssignmentNode.process"\r
- }\r
- ],\r
- "on_success" : [\r
- "download-baseconfig"\r
- ]\r
- },\r
- "download-baseconfig" : {\r
- "description" : "Call Download Base Config Component",\r
- "target" : "activate-netconf",\r
- "activities" : [\r
- {\r
- "call_operation": "NetconfTransactionNode.process"\r
- }\r
- ],\r
- "on_success" : [\r
- "download-licence"\r
- ]\r
- },\r
- "download-licence" : {\r
- "description" : "Call Download Licence Component",\r
- "target" : "activate-netconf",\r
- "activities" : [\r
- {\r
- "call_operation": "NetconfTransactionNode.process"\r
- }\r
- ]\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "artifact_types": {\r
- "artifact-template-velocity": {\r
- "description": " Velocity Template used for Configuration",\r
- "version": "1.0.0",\r
- "file_ext": [\r
- "vtl"\r
- ],\r
- "derived_from": "tosca.artifacts.Implementation"\r
- },\r
- "artifact-mapping-resource": {\r
- "description": " Velocity Template Resource Mapping File used along with Configuration template",\r
- "version": "1.0.0",\r
- "file_ext": [\r
- "json"\r
- ],\r
- "derived_from": "tosca.artifacts.Implementation"\r
- },\r
- "artifact-script-kotlin": {\r
- "description": " Kotlin Script Template used for Configuration",\r
- "version": "1.0.0",\r
- "file_ext": [\r
- "kt"\r
- ],\r
- "derived_from": "tosca.artifacts.Implementation"\r
- },\r
- "artifact-script-python": {\r
- "description": " Kotlin Script Template used for Configuration",\r
- "version": "1.0.0",\r
- "file_ext": [\r
- "py"\r
- ],\r
- "derived_from": "tosca.artifacts.Implementation"\r
- },\r
- "artifact-bpmn-camunda": {\r
- "description": " Camunda BPM File",\r
- "version": "1.0.0",\r
- "file_ext": [\r
- "bpmn"\r
- ],\r
- "derived_from": "tosca.artifacts.Implementation"\r
- },\r
- "artifact-component-jar": {\r
- "description": "Component Jar",\r
- "version": "1.0.0",\r
- "file_ext": [\r
- "jar"\r
- ],\r
- "derived_from": "tosca.artifacts.Implementation"\r
- }\r
- },\r
- "node_types": {\r
- "bpmn-activate": {\r
- "description": "This is BPMN Activate node type",\r
- "version": "1.0.0",\r
- "properties": {\r
- "content": {\r
- "required": false,\r
- "type": "string"\r
- },\r
- "process-name": {\r
- "required": false,\r
- "type": "string"\r
- },\r
- "version": {\r
- "required": false,\r
- "type": "string",\r
- "default" : "LATEST"\r
- }\r
- },\r
- "derived_from": "tosca.nodes.Component"\r
- },\r
- "tosca.nodes.Component": {\r
- "description": "This is Resource Assignment Component API",\r
- "version": "1.0.0",\r
- "properties": {\r
- "type": {\r
- "description": "Request Id used to store the generated configuration, in the database along with the template-name",\r
- "required": false,\r
- "type": "string"\r
- }\r
- },\r
- "interfaces": {\r
- "DefaultOperation": {\r
- "operations": {\r
- "validate": {\r
- "inputs": {\r
- "action-name": {\r
- "description": "validate for action",\r
- "required": false,\r
- "type": "string"\r
- }\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "artifacts" :{\r
- "component-jar": {\r
- "description": "Component Jar",\r
- "type": "artifact-component-jar",\r
- "file": "Component/basecomponent.jar"\r
- }\r
- },\r
- "derived_from": "tosca.nodes.Root"\r
- },\r
- "tosca.nodes.component.Python": {\r
- "description": "This is Resource Assignment Python Component API",\r
- "version": "1.0.0",\r
- "properties": {\r
- "type": {\r
- "description": "Request Id used to store the generated configuration, in the database along with the template-name",\r
- "required": false,\r
- "type": "string"\r
- }\r
- },\r
- "interfaces": {\r
- "DefaultOperation": {\r
- "operations": {\r
- "validate": {\r
- "inputs": {\r
- "action-name": {\r
- "description": "validate for action",\r
- "required": false,\r
- "type": "string"\r
- }\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "artifacts" :{\r
- "component-jar": {\r
- "description": "Component Jar",\r
- "type": "artifact-component-jar",\r
- "file": "Component/basecomponent.jar"\r
- }\r
- },\r
- "derived_from": "tosca.nodes.Root"\r
- },\r
- "component-resource-assignment": {\r
- "description": "This is Resource Assignment Component API",\r
- "version": "1.0.0",\r
- "properties": {\r
- "request-id": {\r
- "description": "Request Id used to store the generated configuration, in the database along with the template-name",\r
- "required": true,\r
- "type": "string"\r
- }\r
- },\r
- "interfaces": {\r
- "DefaultComponentNode": {\r
- "operations": {\r
- "process": {\r
- "inputs": {\r
- "action-name": {\r
- "description": "Recipe 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",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "resource-type": {\r
- "required": false,\r
- "type": "string"\r
- },\r
- "request-id": {\r
- "description": "Request Id used to store the generated configuration, in the database along with the template-name",\r
- "required": true,\r
- "type": "string"\r
- },\r
- "resource-id": {\r
- "description": "Id used to pull the data content from the data base. Either template-data or resource-id should be present",\r
- "required": true,\r
- "type": "string"\r
- },\r
- "template-content": {\r
- "description": "Id used to pull the data content from the data base. Either template-data or resource-id should be present",\r
- "required": true,\r
- "type": "string"\r
- },\r
- "mapping-content": {\r
- "description": "Id used to pull the data content from the data base. Either template-data or resource-id should be present",\r
- "required": true,\r
- "type": "string"\r
- }\r
- },\r
- "outputs": {\r
- "resource-assignment-params": {\r
- "required": true,\r
- "type": "string"\r
- },\r
- "status": {\r
- "required": true,\r
- "type": "string"\r
- }\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "derived_from": "tosca.nodes.Component"\r
- },\r
- "component-resource-assignment-python": {\r
- "description": "This is Resource Assignment Component API",\r
- "version": "1.0.0",\r
- "properties": {\r
- "request-id": {\r
- "description": "Request Id used to store the generated configuration, in the database along with the template-name",\r
- "required": true,\r
- "type": "string"\r
- }\r
- },\r
- "interfaces": {\r
- "DefaultComponentNode": {\r
- "operations": {\r
- "process": {\r
- "inputs": {\r
- "action-name": {\r
- "description": "Recipe 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",\r
- "required": false,\r
- "type": "string"\r
- }\r
- },\r
- "outputs": {\r
- "resource-assignment-params": {\r
- "required": true,\r
- "type": "string"\r
- },\r
- "status": {\r
- "required": true,\r
- "type": "string"\r
- }\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "derived_from": "tosca.nodes.component.Python"\r
- }\r
- },\r
- "data_types": {\r
- "sample-property" : {\r
- "description": "This is sample data type",\r
- "version": "1.0.0",\r
- "properties": {\r
- "content": {\r
- "required": false,\r
- "type": "string"\r
- },\r
- "process-name": {\r
- "required": false,\r
- "type": "string"\r
- },\r
- "version": {\r
- "required": false,\r
- "type": "string",\r
- "default" : "LATEST"\r
- }\r
- },\r
- "derived_from" : "tosca.datatypes.Root"\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-{\r
- "assignments": "Sample Assignments"\r
-}
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"\r
- xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"\r
- xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"\r
- xmlns:camunda="http://camunda.org/schema/1.0/bpmn"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1"\r
- targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.11.2">\r
- <bpmn:process id="ActivateProcess" isExecutable="true">\r
- <bpmn:startEvent id="StartEvent_1">\r
- <bpmn:outgoing>SequenceFlow_0l0dq58</bpmn:outgoing>\r
- </bpmn:startEvent>\r
- <bpmn:endEvent id="EndEvent_1pr0kil">\r
- <bpmn:incoming>SequenceFlow_1ay0k6p</bpmn:incoming>\r
- </bpmn:endEvent>\r
- <bpmn:sequenceFlow id="SequenceFlow_0l0dq58" sourceRef="StartEvent_1" targetRef="activate_device_task"/>\r
- <bpmn:sequenceFlow id="SequenceFlow_1ay0k6p" sourceRef="activate_device_task" targetRef="EndEvent_1pr0kil"/>\r
- <bpmn:serviceTask id="activate_device_task" name="Activate Device"\r
- camunda:delegateExpression="${componentDelegateService}">\r
- <bpmn:extensionElements>\r
- <camunda:inputOutput>\r
- <camunda:inputParameter name="selector"><![CDATA[resource-assignment\r
-]]></camunda:inputParameter>\r
- </camunda:inputOutput>\r
- </bpmn:extensionElements>\r
- <bpmn:incoming>SequenceFlow_0l0dq58</bpmn:incoming>\r
- <bpmn:outgoing>SequenceFlow_1ay0k6p</bpmn:outgoing>\r
- </bpmn:serviceTask>\r
- </bpmn:process>\r
- <bpmndi:BPMNDiagram id="BPMNDiagram_1">\r
- <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ActivateProcess">\r
- <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">\r
- <dc:Bounds x="175" y="143" width="36" height="36"/>\r
- <bpmndi:BPMNLabel>\r
- <dc:Bounds x="148" y="179" width="90" height="20"/>\r
- </bpmndi:BPMNLabel>\r
- </bpmndi:BPMNShape>\r
- <bpmndi:BPMNShape id="EndEvent_1pr0kil_di" bpmnElement="EndEvent_1pr0kil">\r
- <dc:Bounds x="575" y="114" width="36" height="36"/>\r
- <bpmndi:BPMNLabel>\r
- <dc:Bounds x="593" y="154" width="0" height="12"/>\r
- </bpmndi:BPMNLabel>\r
- </bpmndi:BPMNShape>\r
- <bpmndi:BPMNEdge id="SequenceFlow_0l0dq58_di" bpmnElement="SequenceFlow_0l0dq58">\r
- <di:waypoint xsi:type="dc:Point" x="211" y="161"/>\r
- <di:waypoint xsi:type="dc:Point" x="273" y="161"/>\r
- <di:waypoint xsi:type="dc:Point" x="273" y="149"/>\r
- <di:waypoint xsi:type="dc:Point" x="334" y="149"/>\r
- <bpmndi:BPMNLabel>\r
- <dc:Bounds x="288" y="149" width="0" height="12"/>\r
- </bpmndi:BPMNLabel>\r
- </bpmndi:BPMNEdge>\r
- <bpmndi:BPMNEdge id="SequenceFlow_1ay0k6p_di" bpmnElement="SequenceFlow_1ay0k6p">\r
- <di:waypoint xsi:type="dc:Point" x="434" y="149"/>\r
- <di:waypoint xsi:type="dc:Point" x="505" y="149"/>\r
- <di:waypoint xsi:type="dc:Point" x="505" y="132"/>\r
- <di:waypoint xsi:type="dc:Point" x="575" y="132"/>\r
- <bpmndi:BPMNLabel>\r
- <dc:Bounds x="520" y="134.5" width="0" height="12"/>\r
- </bpmndi:BPMNLabel>\r
- </bpmndi:BPMNEdge>\r
- <bpmndi:BPMNShape id="ServiceTask_0e8ek4f_di" bpmnElement="activate_device_task">\r
- <dc:Bounds x="334" y="109" width="100" height="80"/>\r
- </bpmndi:BPMNShape>\r
- </bpmndi:BPMNPlane>\r
- </bpmndi:BPMNDiagram>\r
-</bpmn:definitions>\r
+++ /dev/null
-from com.brvith.orchestrator.core.interfaces import ComponentNode\r
-\r
-class SamplePythonComponentNode(ComponentNode):\r
- def prepare(self, context, componentContext):\r
- return None\r
-\r
- def prepare(self, context, componentContext):\r
- return None
\ No newline at end of file
+++ /dev/null
-TOSCA-Meta-File-Version: 1.0.0\r
-CSAR-Version: 1.0\r
-Created-By: Brinda Santh M\r
-Entry-Definitions: Definitions/activation-blueprint.json\r
-Template-Tags: vrr-test, Brinda Santh\r
-\r
-Name: Plans/ActivateProcess.bpmn\r
-Content-Type: application/vnd.oasis.bpmn\r
+++ /dev/null
-This is Sample Velocity Template
\ No newline at end of file
}\r
},\r
"derived_from": "tosca.nodes.Component"\r
+ },\r
+ "tosca.nodes.DG" : {\r
+ "description" : "This is Directed Graph Node Type",\r
+ "version" : "1.0.0",\r
+ "derived_from" : "tosca.nodes.Root"\r
+ },\r
+ "tosca.nodes.Vnf" : {\r
+ "description" : "This is VNF Node Type",\r
+ "version" : "1.0.0",\r
+ "derived_from" : "tosca.nodes.Root"\r
+ },\r
+ "tosca.nodes.Artifact" : {\r
+ "description" : "This is Deprecated Artifact Node Type.",\r
+ "version" : "1.0.0",\r
+ "derived_from" : "tosca.nodes.Root"\r
+ },\r
+ "tosca.nodes.Component" : {\r
+ "description" : "This is default Component Node",\r
+ "version" : "1.0.0",\r
+ "derived_from" : "tosca.nodes.Root"\r
}\r
},\r
"data_types": {\r
public void testBluePrintDirs() {\r
List<String> dirs = ConfigModelUtils.getBlueprintNames("load/blueprints");\r
Assert.assertNotNull("Failed to get blueprint directories", dirs);\r
- Assert.assertEquals("Failed to get actual directories", 2, dirs.size());\r
+ Assert.assertEquals("Failed to get actual directories", 1, dirs.size());\r
}\r
\r
@Test\r
public void validateServiceTemplate() throws Exception {\r
- validateServiceTemplate("load/blueprints/baseconfiguration/Definitions/activation-blueprint.json");\r
validateServiceTemplate("load/blueprints/vrr-test/Definitions/vrr-test.json");\r
}\r
\r
- //@Test\r
+ @Test\r
public void validateEnhancedServiceTemplate() throws Exception {\r
ServiceTemplate serviceTemplate = JacksonUtils\r
.readValueFromClassPathFile("enhance/enhanced-template.json", ServiceTemplate.class);\r
},\r
"derived_from" : "tosca.nodes.DG"\r
},\r
+ "tosca.nodes.Component" : {\r
+ "description" : "This is default Component Node",\r
+ "version" : "1.0.0",\r
+ "derived_from" : "tosca.nodes.Root"\r
+ },\r
"component-resource-assignment" : {\r
"description" : "This is Resource Assignment Component API",\r
"version" : "1.0.0",\r
},\r
"derived_from" : "tosca.nodes.Component"\r
},\r
+ "tosca.nodes.DG" : {\r
+ "description" : "This is Directed Graph Node Type",\r
+ "version" : "1.0.0",\r
+ "derived_from" : "tosca.nodes.Root"\r
+ },\r
"artifact-config-template" : {\r
"description" : "This is Configuration Velocity Template",\r
"version" : "1.0.0",\r
},\r
"derived_from" : "tosca.nodes.Vnf"\r
},\r
+ "tosca.nodes.Vnf" : {\r
+ "description" : "This is VNF Node Type",\r
+ "version" : "1.0.0",\r
+ "derived_from" : "tosca.nodes.Root"\r
+ },\r
"component-netconf-executor" : {\r
"description" : "This is Netconf Transaction Configuration Component API",\r
"version" : "1.0.0",\r
"required" : true,\r
"type" : "string"\r
},\r
- "service-template-name" : {\r
+ "template-name" : {\r
"description" : "Service Template Name",\r
"required" : true,\r
"type" : "string"\r
},\r
- "service-template-version" : {\r
+ "template-version" : {\r
"description" : "Service Template Version",\r
"required" : true,\r
"type" : "string"\r
},\r
"derived_from" : "tosca.nodes.Component"\r
},\r
+ "tosca.nodes.Artifact" : {\r
+ "description" : "This is Deprecated Artifact Node Type.",\r
+ "version" : "1.0.0",\r
+ "derived_from" : "tosca.nodes.Root"\r
+ },\r
"dg-activate-netconf" : {\r
"description" : "This is Download Netconf Directed Graph",\r
"version" : "1.0.0",\r
},\r
"inputs" : {\r
"action-name" : "{ \"get_input\" : \"action-name\" }",\r
- "template_name" : "{ \"get_attribute\" : \"template_name\" }",\r
- "service-template-version" : "{ \"get_attribute\" : \"service-template-version\" }",\r
+ "template-name" : "{ \"get_attribute\" : \"template_name\" }",\r
+ "template-version" : "{ \"get_attribute\" : \"template_version\" }",\r
"resource-type" : "vnf-type",\r
"request-id" : "{ \"get_input\" : \"request-id\" }",\r
"resource-id" : "{ \"get_input\" : \"hostname\" }",\r