"version": "1.0.0",
"derived_from": "tosca.nodes.Root"
},
- "tosca.nodes.DG": {
+ "tosca.nodes.Workflow": {
"description": "This is Directed Graph Node Type",
"version": "1.0.0",
"derived_from": "tosca.nodes.Root"
}
}
},
- "derived_from": "tosca.nodes.DG"
+ "derived_from": "tosca.nodes.Workflow"
},
"artifact-config-template": {
"description": "This is Configuration Velocity Template",
}
}
},
- "derived_from": "tosca.nodes.DG"
+ "derived_from": "tosca.nodes.Workflow"
},
"source-input": {
"description": "This is Input Resource Source Node Type",
"version": "1.0.0",
"derived_from": "tosca.nodes.Root"
},
- "tosca.nodes.DG": {
+ "tosca.nodes.Workflow": {
"description": "This is Directed Graph Node Type",
"version": "1.0.0",
"derived_from": "tosca.nodes.Root"
}
}
},
- "derived_from" : "tosca.nodes.DG"
+ "derived_from" : "tosca.nodes.Workflow"
},
"source-input" : {
"description" : "This is Input Resource Source Node Type",
"version" : "1.0.0",
"derived_from" : "tosca.nodes.Root"
},
- "tosca.nodes.DG" : {
+ "tosca.nodes.Workflow" : {
"description" : "This is Directed Graph Node Type",
"version" : "1.0.0",
"derived_from" : "tosca.nodes.Root"
}
}
},
- "derived_from" : "tosca.nodes.DG"
+ "derived_from" : "tosca.nodes.Workflow"
},
"source-input" : {
"description" : "This is Input Resource Source Node Type",
"version" : "1.0.0",
"derived_from" : "tosca.nodes.Root"
},
- "tosca.nodes.DG" : {
+ "tosca.nodes.Workflow" : {
"description" : "This is Directed Graph Node Type",
"version" : "1.0.0",
"derived_from" : "tosca.nodes.Root"
+++ /dev/null
-{
- "artifact_types" : { }
-}
\ No newline at end of file
+++ /dev/null
-{
- "tosca_definitions_version": "controller_blueprint_1_0_0",
- "metadata": {
- "template_author": "Brinda Santh <brindasanth@in.ibm.com>",
- "template_name": "component_invoke",
- "template_version": "1.0.0",
- "template_tags": "brinda, component_invoke"
- },
- "imports": [
- {
- "file": "Definitions/data_types.json"
- },
- {
- "file": "Definitions/relationship_types.json"
- },
- {
- "file": "Definitions/artifact_types.json"
- },
- {
- "file": "Definitions/node_types.json"
- },
- {
- "file": "Definitions/policy_types.json"
- }
- ],
- "topology_template": {
- "workflows": {
- "component-invoke": {
- "steps": {
- "activate-process": {
- "description": "Sample Component Invocation flow",
- "target": "sample-component",
- "activities": [
- {
- "call_operation": "sample-component"
- }
- ]
- }
- },
- "inputs": {
- "request-id": {
- "required": true,
- "type": "string"
- },
- "action-name": {
- "required": true,
- "type": "string"
- },
- "scope-type": {
- "required": true,
- "type": "string"
- },
- "hostname": {
- "required": true,
- "type": "string"
- }
- },
- "outputs": {
- "response-property1": {
- "type": "string",
- "value": "executed"
- },
- "response-property2": {
- "type": "string",
- "value": {
- "get_input": "action-name"
- }
- }
- }
- }
- },
- "node_templates": {
- "sample-component": {
- "type": "component-sample-executor",
- "interfaces": {
- "ComponentSampleExecutor": {
- "operations": {
- "process": {
- "inputs": {
- "sample-property": "sample-value",
- "sample-list-property": [
- "json-parser-service"
- ],
- "dynamic-properties": {
- "prop1": "prop1-value",
- "prop2": "prop2-value"
- }
- },
- "outputs": {
- "response-data": "",
- "status": ""
- }
- }
- }
- }
- }
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-{
- "data_types" : { }
-}
\ No newline at end of file
+++ /dev/null
-{
- "node_types": {
- "component-sample-executor": {
- "description": "This is Sample Component API",
- "version": "1.0.0",
- "interfaces": {
- "ComponentSampleExecutor": {
- "operations": {
- "process": {
- "inputs": {
- "sample-property": {
- "description": "Sample Property.",
- "required": true,
- "type": "string"
- },
- "sample-list-property": {
- "description": "Dependent Step Components NodeTemplate name.",
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- },
- "dynamic-properties": {
- "description": "Dynamic Json Content or DSL Json reference.",
- "required": false,
- "type": "json"
- }
- },
- "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"
- },
- "tosca.nodes.Component": {
- "description": "This is default Component Node",
- "version": "1.0.0",
- "derived_from": "tosca.nodes.Root"
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-{
- "policy_types" : { }
-}
\ No newline at end of file
+++ /dev/null
-{
- "relationship_types" : { }
-}
\ No newline at end of file
+++ /dev/null
-{ }
\ No newline at end of file
+++ /dev/null
-TOSCA-Meta-File-Version: 1.0.0
-CSAR-Version: 1.0
-Created-By: Brinda Santh <brindasanth@in.ibm.com>
-Entry-Definitions: Definitions/component_invoke.json
-Template-Tags: Brinda Santh, component_invoke
\ No newline at end of file
}
}
},
- "derived_from" : "tosca.nodes.DG"
+ "derived_from" : "tosca.nodes.Workflow"
},
"source-capability" : {
"description" : "This is Component Resource Source Node Type",
"version" : "1.0.0",
"derived_from" : "tosca.nodes.Root"
},
- "tosca.nodes.DG" : {
+ "tosca.nodes.Workflow" : {
"description" : "This is Directed Graph Node Type",
"version" : "1.0.0",
"derived_from" : "tosca.nodes.Root"
+++ /dev/null
-{\r
- "description": "This is Configuration Velocity Template",\r
- "version": "1.0.0",\r
- "properties": {\r
- "action-names": {\r
- "required": true,\r
- "type": "list",\r
- "entry_schema": {\r
- "type": "string"\r
- }\r
- }\r
- },\r
- "capabilities": {\r
- "content": {\r
- "type": "tosca.capabilities.Content",\r
- "properties": {\r
- "content": {\r
- "required": true,\r
- "type": "string"\r
- }\r
- }\r
- },\r
- "mapping": {\r
- "type": "tosca.capabilities.Mapping",\r
- "properties": {\r
- "mapping": {\r
- "required": false,\r
- "type": "list",\r
- "entry_schema": {\r
- "type": "datatype-resource-assignment"\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "derived_from": "tosca.nodes.Artifact"\r
-}
\ No newline at end of file
+++ /dev/null
-{\r
- "description": "This is Generate Configuration Component API",\r
- "version": "1.0.0",\r
- "capabilities": {\r
- "component-node": {\r
- "type": "tosca.capabilities.Node"\r
- }\r
- },\r
- "interfaces": {\r
- "ConfigGeneratorComponent": {\r
- "operations": {\r
- "process": {\r
- "inputs": {\r
- "template-data": {\r
- "description": "Conditional : JSON string which is used to mash with template. Either template-data or ( resource-id and resource-type ) should be present",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "template-content": {\r
- "description": "Conditional : Dynamic Template used to generate Configuration.",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "resource-type": {\r
- "description": "Conditional : resource-type used to pull the data content from the data base. Either template-data or ( resource-id and resource-type ) should be present",\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": "Conditional : Id used to pull the data content from the data base. Either template-data or ( resource-id and resource-type ) should be present",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "action-name": {\r
- "description": "Conditional : 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",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "template-name": {\r
- "description": "Conditional : Name of the Artifact Node Template, to get the template Content. If template-content is present, then content wont be reterived from the Artifact Node Template.",\r
- "required": true,\r
- "type": "string"\r
- }\r
- },\r
- "outputs": {\r
- "generated-config": {\r
- "description": "Generated Configuration for the Template adn Resource Data",\r
- "required": true,\r
- "type": "string"\r
- },\r
- "mask-info": {\r
- "description": "If template contains mask encription keys, then this mask-info field will be generated, This JSON Content alligns to the bean org.onap.ccsdk.cds.controllerblueprints.core.data.custom.MaskInfo ",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "status": {\r
- "description": "Status of the Component Execution ( success or failure )",\r
- "required": true,\r
- "type": "string"\r
- }\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "derived_from": "tosca.nodes.Component"\r
-}
\ No newline at end of file
}
}
},
- "derived_from": "tosca.nodes.component.Jython"
+ "derived_from": "tosca.nodes.Component"
}
\ No newline at end of file
+++ /dev/null
-{
- "description": "This is Sample Component API",
- "version": "1.0.0",
- "interfaces": {
- "ComponentSampleExecutor": {
- "operations": {
- "process": {
- "inputs": {
- "sample-property": {
- "description": "Sample Property.",
- "required": true,
- "type": "string"
- },
- "sample-list-property": {
- "required": true,
- "description": "Dependent Step Components NodeTemplate name.",
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- },
- "dynamic-properties": {
- "description": "Dynamic Json Content or DSL Json reference.",
- "required": false,
- "type": "json"
- }
- },
- "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"
-}
\ No newline at end of file
}
}
},
- "derived_from": "tosca.nodes.DG"
+ "derived_from": "tosca.nodes.Workflow"
}
\ No newline at end of file
{
"description": "This is Default Resource Source Node Type",
"version": "1.0.0",
- "properties": {
- "key": {
- "required": false,
- "type": "string"
- },
- "key-dependencies": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- }
- },
+ "properties": { },
"derived_from": "tosca.nodes.ResourceSource"
}
\ No newline at end of file
{
"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"
- }
- }
- },
+ "properties": { },
"derived_from": "tosca.nodes.ResourceSource"
}
\ No newline at end of file
"properties": {
"type": {
"required": true,
+ "default": "SQL",
"type": "string",
"constraints": [
{
"valid_values": [
- "SQL",
- "PLSQL"
+ "SQL"
]
}
]
"version": "1.0.0",
"properties": {
"type": {
- "required": false,
+ "required": true,
"type": "string",
"default": "JSON",
"constraints": [
]
},
"verb": {
- "required": false,
+ "required": true,
"type": "string",
"default": "GET",
"constraints": [
-{\r
- "description": "This is Directed Graph Node Type",\r
- "version": "1.0.0",\r
- "derived_from": "tosca.nodes.Root"\r
+{
+ "description": "This is Directed Graph Node Type",
+ "version": "1.0.0",
+ "derived_from": "tosca.nodes.Root"
}
\ No newline at end of file
+++ /dev/null
-{\r
- "description": "This is Jython Component",\r
- "version": "1.0.0",\r
- "derived_from": "tosca.nodes.Root"\r
-}
\ No newline at end of file
+++ /dev/null
-{
- "description": "This is Kotlin Component",
- "version": "1.0.0",
- "derived_from": "tosca.nodes.Root"
-}
\ No newline at end of file
+++ /dev/null
-{\r
- "description": "This is Python Component",\r
- "version": "1.0.0",\r
- "derived_from": "tosca.nodes.Root"\r
-}
\ No newline at end of file
componentWorkflowExecutionService
.executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, properties)
}
- derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_DG, true) -> {
+ derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW, true) -> {
dgWorkflowExecutionService
.executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, properties)
}
}
},
- "derived_from": "tosca.nodes.DG"
+ "derived_from": "tosca.nodes.Workflow"
}
\ No newline at end of file
}
}
},
- "derived_from": "tosca.nodes.DG"
+ "derived_from": "tosca.nodes.Workflow"
}
\ No newline at end of file
}
}
},
- "derived_from": "tosca.nodes.DG"
+ "derived_from": "tosca.nodes.Workflow"
}
\ No newline at end of file
}
}
},
- "derived_from": "tosca.nodes.DG"
+ "derived_from": "tosca.nodes.Workflow"
}
\ No newline at end of file
const val MODEL_TYPE_RELATIONSHIPS_ATTACH_TO = "tosca.relationships.AttachesTo"
const val MODEL_TYPE_RELATIONSHIPS_ROUTES_TO = "tosca.relationships.RoutesTo"
- const val MODEL_TYPE_NODE_DG = "tosca.nodes.DG"
+ const val MODEL_TYPE_NODE_WORKFLOW = "tosca.nodes.Workflow"
const val MODEL_TYPE_NODE_COMPONENT = "tosca.nodes.Component"
const val MODEL_TYPE_NODE_VNF = "tosca.nodes.Vnf"
const val MODEL_TYPE_NODE_RESOURCE_SOURCE = "tosca.nodes.ResourceSource"
@JvmStatic
val validNodeTypeDerivedFroms: MutableList<String> = arrayListOf(
BluePrintConstants.MODEL_TYPE_NODES_ROOT,
- BluePrintConstants.MODEL_TYPE_NODE_DG,
+ BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW,
BluePrintConstants.MODEL_TYPE_NODE_COMPONENT,
BluePrintConstants.MODEL_TYPE_NODE_VNF,
BluePrintConstants.MODEL_TYPE_NODE_RESOURCE_SOURCE,
val nodeTypeDerivedFrom = bluePrintRuntimeService.bluePrintContext().nodeTemplateNodeType(it).derivedFrom
- check(nodeTypeDerivedFrom == BluePrintConstants.MODEL_TYPE_NODE_DG
+ check(nodeTypeDerivedFrom == BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW
|| nodeTypeDerivedFrom == BluePrintConstants.MODEL_TYPE_NODE_COMPONENT) {
"NodeType(${nodeTemplate.type}) derived from is '$nodeTypeDerivedFrom', Expected " +
- "'${BluePrintConstants.MODEL_TYPE_NODE_DG}' or '${BluePrintConstants.MODEL_TYPE_NODE_COMPONENT}'"
+ "'${BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW}' or '${BluePrintConstants.MODEL_TYPE_NODE_COMPONENT}'"
}
} catch (e: Exception) {
bluePrintRuntimeService.getBluePrintError()
assertEquals(1, bluePrintRuntime.getBluePrintError().errors.size)
assertEquals("Failed to validate Workflow(resource-assignment)'s step(test)'s definition : " +
"resource-assignment/steps/test : NodeType(TestNodeType) derived from is 'tosca.nodes.TEST', " +
- "Expected 'tosca.nodes.DG' or 'tosca.nodes.Component'", bluePrintRuntime.getBluePrintError().errors[0])
+ "Expected 'tosca.nodes.Workflow' or 'tosca.nodes.Component'", bluePrintRuntime.getBluePrintError().errors[0])
}
@Test
derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_COMPONENT, true) -> {
// DO Nothing
}
- derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_DG, true) -> {
+ derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW, true) -> {
enhanceDGStepTargets(name, workflow, firstNodeTemplateName)
}
else -> {
}\r
}\r
},\r
- "derived_from": "tosca.nodes.DG"\r
+ "derived_from": "tosca.nodes.Workflow"\r
},\r
"dg-activate-netconf": {\r
"description": "This is Download Netconf Directed Graph",\r
}\r
}\r
},\r
- "derived_from": "tosca.nodes.DG"\r
+ "derived_from": "tosca.nodes.Workflow"\r
},\r
"artifact-config-template": {\r
"description": "This is Configuration Velocity Template",\r
testComponentInvokeEnhancementAndValidation(basePath, "base-enhance")
}
- @Test
- @Throws(Exception::class)
- fun testComponentInvokeEnhancementAndValidation() {
- val basePath = "./../../../../components/model-catalog/blueprint-model/test-blueprint/component_invoke"
- testComponentInvokeEnhancementAndValidation(basePath, "component-enhance")
- }
-
@Test
@Throws(Exception::class)
fun testGoldenEnhancementAndValidation() {