From: Muthuramalingam, Brinda Santh(bs2796) Date: Fri, 7 Sep 2018 22:43:20 +0000 (+0000) Subject: Controller Blueprints Microservice X-Git-Tag: 0.3.0~62 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F33%2F65333%2F1;p=ccsdk%2Fapps.git Controller Blueprints Microservice Modify get_input, get_attribute, get_property and get_artifact functions string implementation to Json Implementation. Change-Id: I6d4aadd370dc23127a176964f84fc9bb5e7ab5ee Issue-ID: CCSDK-432 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) --- diff --git a/components/core/load/blueprints/baseconfiguration/Definitions/activation-blueprint.json b/components/core/load/blueprints/baseconfiguration/Definitions/activation-blueprint.json index 714195f3..9c70d6ea 100644 --- a/components/core/load/blueprints/baseconfiguration/Definitions/activation-blueprint.json +++ b/components/core/load/blueprints/baseconfiguration/Definitions/activation-blueprint.json @@ -40,7 +40,7 @@ "component-node": {} }, "interfaces": { - "org-onap-sdnc-config-assignment-service-ConfigAssignmentNode": { + "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": { "operations": { "process": { "inputs": { @@ -258,7 +258,7 @@ } }, "interfaces": { - "org-onap-sdnc-config-assignment-service-ConfigAssignmentNode": { + "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": { "operations": { "process": { "inputs": { diff --git a/components/core/load/blueprints/simple-baseconfig/Definitions/sample-nodetype.json b/components/core/load/blueprints/simple-baseconfig/Definitions/sample-nodetype.json index 6d469ea8..207fcc41 100644 --- a/components/core/load/blueprints/simple-baseconfig/Definitions/sample-nodetype.json +++ b/components/core/load/blueprints/simple-baseconfig/Definitions/sample-nodetype.json @@ -1,34 +1,5 @@ { "description": "This is Resource Assignment Component API", "version": "1.0.0", - "properties": { - "type": { - "description": "Request Id used to store the generated configuration, in the database along with the template-name", - "required": false, - "type": "string" - } - }, - "interfaces": { - "DefaultOperation": { - "operations": { - "validate": { - "inputs": { - "action-name": { - "description": "validate for action", - "required": false, - "type": "string" - } - } - } - } - } - }, - "artifacts" :{ - "component-jar": { - "description": "Component Jar", - "type": "artifact-component-jar", - "file": "Component/basecomponent.jar" - } - }, - "derived_from": "tosca.nodes.Root" + "derived_from": "tosca.nodes.Root" } \ No newline at end of file diff --git a/components/core/load/blueprints/simple-baseconfig/Definitions/simple-baseconfig.json b/components/core/load/blueprints/simple-baseconfig/Definitions/simple-baseconfig.json index 65028ace..cb091da0 100644 --- a/components/core/load/blueprints/simple-baseconfig/Definitions/simple-baseconfig.json +++ b/components/core/load/blueprints/simple-baseconfig/Definitions/simple-baseconfig.json @@ -38,7 +38,7 @@ "login-key": "sdnc", "login-account": "sndc-local", "source": "local", - "target-ip-address": "{\"get_attribute\":\"lo0-local-ipv4-address\"}", + "target-ip-address": { "get_attribute": ["SELF", "lo0-local-ipv4-address"]}, "port-number": 22, "connection-time-out": 30 } @@ -58,21 +58,21 @@ } }, "interfaces": { - "org-openecomp-sdnc-netconf-adaptor-service-NetconfExecutorNode": { + "org-onap-ccsdk-netconf-adaptor-service-NetconfExecutorNode": { "operations": { "process": { "inputs": { - "action-name": "{ \"get_input\" : \"action-name\" }", - "service-template-name": "{ \"get_attribute\" : \"template_name\" }", - "service-template-version": "{ \"get_attribute\" : \"service-template-version\" }", + "action-name": { "get_input" : "action-name" }, + "service-template-name": { "get_input" : "template_name" }, + "service-template-version": { "get_input" : "service-template-version" }, "resource-type": "vnf-type", - "request-id": "{ \"get_input\" : \"request-id\" }", - "resource-id": "{ \"get_input\" : \"hostname\" }", + "request-id": { "get_input" : "request-id" }, + "resource-id": { "get_input" : "hostname" }, "execution-script": "execution-script" }, "outputs": { - "response-data": "{ \"get_attribute\" : \"netconf-executor-baseconfig.response-data\" }", - "status": "{ \"get_attribute\" : \"netconf-executor-baseconfig.status\" }" + "response-data": { "get_input" : ["SELF", "netconf-executor-baseconfig.response-data"] }, + "status": { "get_input" : ["SELF", "netconf-executor-baseconfig.status"] } }, "implementation" : { "primary" : "file://netconf_adaptor/DefaultBaseLicenceConfig.py" @@ -88,7 +88,7 @@ "component-node": {} }, "interfaces": { - "org-openecomp-sdnc-config-assignment-service-ConfigAssignmentNode": { + "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": { "operations": { "process": { "inputs": { @@ -96,12 +96,12 @@ "base-config-template", "licence-template" ], - "action-name": "{ \"get_input\" : \"action-name\" }", - "service-template-name": "{ \"get_attribute\" : \"template_name\" }", - "service-template-version": "{ \"get_attribute\" : \"service-template-version\" }", + "action-name": { "get_input" : "action-name" }, + "service-template-name": { "get_input" : "template_name" }, + "service-template-version": { "get_input" : "service-template-version" }, "resource-type": "vnf-type", - "request-id": "{ \"get_input\" : \"request-id\" }", - "resource-id": "{ \"get_input\" : \"hostname\" }" + "request-id": { "get_input" : "request-id" }, + "resource-id": { "get_input" : "hostname" } }, "outputs": { "resource-assignment-params": "success", @@ -127,12 +127,7 @@ } }, "capabilities": { - "dg-node": {}, - "content": { - "properties": { - "type": "json" - } - } + "dg-node": {} }, "interfaces": { "CONFIG": { diff --git a/components/core/load/model_type/node_type/component-config-generator.json b/components/core/load/model_type/node_type/component-config-generator.json index 764f9e89..9e86b8ae 100644 --- a/components/core/load/model_type/node_type/component-config-generator.json +++ b/components/core/load/model_type/node_type/component-config-generator.json @@ -7,7 +7,7 @@ } }, "interfaces": { - "org-openecomp-sdnc-config-generator-service-ConfigGeneratorNode": { + "org-onap-ccsdk-config-generator-service-ConfigGeneratorNode": { "operations": { "process": { "inputs": { diff --git a/components/core/load/model_type/node_type/component-netconf-executor.json b/components/core/load/model_type/node_type/component-netconf-executor.json index aed667aa..7dcff583 100644 --- a/components/core/load/model_type/node_type/component-netconf-executor.json +++ b/components/core/load/model_type/node_type/component-netconf-executor.json @@ -14,7 +14,7 @@ } }, "interfaces": { - "org-openecomp-sdnc-netconf-adaptor-service-NetconfExecutorNode": { + "org-onap-ccsdk-netconf-adaptor-service-NetconfExecutorNode": { "operations": { "process": { "inputs": { diff --git a/components/core/load/model_type/node_type/component-resource-assignment.json b/components/core/load/model_type/node_type/component-resource-assignment.json index 03f3c284..1389bc32 100644 --- a/components/core/load/model_type/node_type/component-resource-assignment.json +++ b/components/core/load/model_type/node_type/component-resource-assignment.json @@ -7,7 +7,7 @@ } }, "interfaces": { - "org-onap-sdnc-config-assignment-service-ConfigAssignmentNode": { + "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": { "operations": { "process": { "inputs": { diff --git a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/ConfigModelConstant.kt b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/ConfigModelConstant.kt index 84592204..8bfa2db7 100644 --- a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/ConfigModelConstant.kt +++ b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/ConfigModelConstant.kt @@ -31,12 +31,6 @@ object ConfigModelConstant { const val MODEL_TYPE_NODE_ARTIFACT = "tosca.nodes.Artifact" - const val MODEL_TYPE_CAPABILITY_NETCONF = "tosca.capability.Netconf" - const val MODEL_TYPE_CAPABILITY_SSH = "tosca.capability.Ssh" - const val MODEL_TYPE_CAPABILITY_SFTP = "tosca.capability.Sftp" - const val MODEL_TYPE_CAPABILITY_CHEF = "tosca.capability.Chef" - const val MODEL_TYPE_CAPABILITY_ANSIBLEF = "tosca.capability.Ansible" - const val CAPABILITY_PROPERTY_MAPPING = "mapping" const val PROPERTY_RECIPE_NAMES = "action-names" diff --git a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintExpressionService.kt b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintExpressionService.kt index 19d515e0..82e232d0 100644 --- a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintExpressionService.kt +++ b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintExpressionService.kt @@ -25,6 +25,7 @@ import org.onap.ccsdk.apps.controllerblueprints.core.data.* import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils import com.att.eelf.configuration.EELFLogger import com.att.eelf.configuration.EELFManager + /** * * @@ -115,32 +116,34 @@ object BluePrintExpressionService { @JvmStatic fun populateAttributeExpression(jsonNode: JsonNode): AttributeExpression { val arrayNode: ArrayNode = jsonNode.first() as ArrayNode - check(arrayNode.size() >= 3) { + check(arrayNode.size() >= 2) { throw BluePrintException(String.format("missing attribute expression, " + "it should be [ , , ," + " , ..., ] , but present {}", jsonNode)) } var reqOrCapEntityName: String? = null - var propertyName = "" - var subProperty: String? = null - if (arrayNode.size() == 2) { - propertyName = arrayNode[1].textValue() - } else if (arrayNode.size() == 3) { - reqOrCapEntityName = arrayNode[1].textValue() - propertyName = arrayNode[2].textValue() - } else if (arrayNode.size() > 3) { - reqOrCapEntityName = arrayNode[1].textValue() - propertyName = arrayNode[2].textValue() - val propertyPaths: List = arrayNode.filterIndexed { index, obj -> - index >= 3 - }.map { it.textValue() } - subProperty = propertyPaths.joinToString("/") + var attributeName = "" + var subAttributeName: String? = null + when { + arrayNode.size() == 2 -> attributeName = arrayNode[1].textValue() + arrayNode.size() == 3 -> { + reqOrCapEntityName = arrayNode[1].textValue() + attributeName = arrayNode[2].textValue() + } + arrayNode.size() > 3 -> { + reqOrCapEntityName = arrayNode[1].textValue() + attributeName = arrayNode[2].textValue() + val propertyPaths: List = arrayNode.filterIndexed { index, _ -> + index >= 3 + }.map { it.textValue() } + subAttributeName = propertyPaths.joinToString("/") + } } return AttributeExpression(modelableEntityName = arrayNode[0].asText(), reqOrCapEntityName = reqOrCapEntityName, - attributeName = propertyName, - subAttributeName = subProperty + attributeName = attributeName, + subAttributeName = subAttributeName ) } diff --git a/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintExpressionServiceTest.kt b/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintExpressionServiceTest.kt index 911a891a..a0214023 100644 --- a/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintExpressionServiceTest.kt +++ b/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintExpressionServiceTest.kt @@ -60,14 +60,22 @@ class BluePrintExpressionServiceTest { @Test fun testAttributeExpression() { - val node : JsonNode = jacksonObjectMapper().readTree("{ \"get_attribute\" : [\"SELF\", \"\",\"attribute-name\", \"resource\", \"name\"] }") + val node : JsonNode = jacksonObjectMapper().readTree("{ \"get_attribute\" : [\"SELF\", \"resource\"] }") val expressionData : ExpressionData = BluePrintExpressionService.getExpressionData(node) assertNotNull(expressionData, " Failed to populate expression data") assertEquals(expressionData.isExpression, true, "Failed to identify as expression") assertNotNull(expressionData.attributeExpression, " Failed to populate attribute expression data") assertEquals("SELF", expressionData.attributeExpression?.modelableEntityName, " Failed to get expected modelableEntityName") - assertEquals("attribute-name", expressionData.attributeExpression?.attributeName, " Failed to get expected attributeName") - assertEquals("resource/name",expressionData.attributeExpression?.subAttributeName, " Failed to populate nested subAttributeName expression data") + assertEquals("resource", expressionData.attributeExpression?.attributeName, " Failed to get expected attributeName") + + val node1 : JsonNode = jacksonObjectMapper().readTree("{ \"get_attribute\" : [\"SELF\", \"\",\"attribute-name\", \"resource\", \"name\"] }") + val expressionData1 : ExpressionData = BluePrintExpressionService.getExpressionData(node1) + assertNotNull(expressionData1, " Failed to populate expression data") + assertEquals(expressionData1.isExpression, true, "Failed to identify as expression") + assertNotNull(expressionData1.attributeExpression, " Failed to populate attribute expression data") + assertEquals("SELF", expressionData1.attributeExpression?.modelableEntityName, " Failed to get expected modelableEntityName") + assertEquals("attribute-name", expressionData1.attributeExpression?.attributeName, " Failed to get expected attributeName") + assertEquals("resource/name",expressionData1.attributeExpression?.subAttributeName, " Failed to populate nested subAttributeName expression data") } diff --git a/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt b/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt index 919dc564..277ec3ac 100644 --- a/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt +++ b/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt @@ -87,7 +87,7 @@ class BluePrintRuntimeServiceTest { log.info("Prepared Context {}", context) val inContext: MutableMap = bluePrintRuntimeService.resolveNodeTemplateInterfaceOperationInputs("resource-assignment-ra-component", - "org-onap-sdnc-config-assignment-service-ConfigAssignmentNode", "process") + "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode", "process") log.info("In Context {}", inContext) @@ -110,18 +110,18 @@ class BluePrintRuntimeServiceTest { val componentContext: MutableMap = hashMapOf() val successValue: JsonNode = jsonNodeFromObject("Success") - componentContext["resource-assignment-ra-component.org-onap-sdnc-config-assignment-service-ConfigAssignmentNode.process.status"] = successValue - componentContext["resource-assignment-ra-component.org-onap-sdnc-config-assignment-service-ConfigAssignmentNode.process.resource-assignment-params"] = null + componentContext["resource-assignment-ra-component.org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode.process.status"] = successValue + componentContext["resource-assignment-ra-component.org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode.process.resource-assignment-params"] = null bluePrintRuntimeService.resolveNodeTemplateInterfaceOperationOutputs("resource-assignment-ra-component", - "org-onap-sdnc-config-assignment-service-ConfigAssignmentNode", "process", componentContext) + "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode", "process", componentContext) assertEquals(NullNode.instance, - context.get("node_templates/resource-assignment-ra-component/interfaces/org-onap-sdnc-config-assignment-service-ConfigAssignmentNode/operations/process/properties/resource-assignment-params"), + context.get("node_templates/resource-assignment-ra-component/interfaces/org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode/operations/process/properties/resource-assignment-params"), "Failed to get operation property resource-assignment-params") assertEquals(successValue, - context.get("node_templates/resource-assignment-ra-component/interfaces/org-onap-sdnc-config-assignment-service-ConfigAssignmentNode/operations/process/properties/status"), + context.get("node_templates/resource-assignment-ra-component/interfaces/org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode/operations/process/properties/status"), "Failed to get operation property status") diff --git a/components/core/src/test/resources/componentnode/default.json b/components/core/src/test/resources/componentnode/default.json index b7265fcd..184b5988 100644 --- a/components/core/src/test/resources/componentnode/default.json +++ b/components/core/src/test/resources/componentnode/default.json @@ -41,13 +41,13 @@ "generate-configuration": { "type": "mock-component-generateConfig", "interfaces": { - "org-openecomp-sdnc-config-params-service-MockComponentNode": { + "org-onap-ccsdk-config-params-service-MockComponentNode": { "operations": { "process": { "inputs": { "entity-type": "vnf-type", "template-content": "sample-template", - "entity-id": "{ \"get_input\" : \"vnf-id\" }" + "entity-id": { "get_input" : "vnf-id" } }, "outputs": { "mergedData": "merged Data", @@ -63,7 +63,7 @@ "node_types": { "mock-component-generateConfig": { "interfaces": { - "org-openecomp-sdnc-config-params-service-MockComponentNode": { + "org-onap-ccsdk-config-params-service-MockComponentNode": { "operations": { "process": { "inputs": { diff --git a/components/core/src/test/resources/properties/convert.json b/components/core/src/test/resources/properties/convert.json index cb7d08e4..af79915f 100644 --- a/components/core/src/test/resources/properties/convert.json +++ b/components/core/src/test/resources/properties/convert.json @@ -19,12 +19,12 @@ "required": true } ], - "pre-data": "{ \"get_attribute\" : \"get-resource-assignment.config-params\" }", + "pre-data": { "get_input" : "get-resource-assignment.config-params" }, "prifix": "get-resource-assignment" }, "outputs": { "resource-assignment-status": "success", - "resource-assignment-params": "{ \"set_value\" : \"get-resource-assignment.config-params\" }" + "resource-assignment-params": "{ \"set_value\" : \"get-resource-assignment.config-params" } } } } diff --git a/components/core/src/test/resources/properties/default.json b/components/core/src/test/resources/properties/default.json index 0ac97f90..ec416dc9 100644 --- a/components/core/src/test/resources/properties/default.json +++ b/components/core/src/test/resources/properties/default.json @@ -1,5 +1,5 @@ { - "default": "{ \"get_input\" : \"loopback-default\" }", + "default": { "get_input" : "loopback-default" }, "domain": "ethernet", "criteria": [ { @@ -8,7 +8,7 @@ "nodeString": "layer3-service-list[].service-data.l3sdn-vnf-fields.vnf-name" }, { - "value": "{ \"get_input\" : \"host-ip-address\" }", + "value": { "get_input" : "host-ip-address" }, "type": "simple", "nodeString": "layer3-service-list[].service-data.l3sdn-vnf-fields.vnf-name" } diff --git a/ms/controllerblueprints/application/load/blueprints/baseconfiguration/Definitions/activation-blueprint.json b/ms/controllerblueprints/application/load/blueprints/baseconfiguration/Definitions/activation-blueprint.json index d4fbf5cf..06e7e930 100644 --- a/ms/controllerblueprints/application/load/blueprints/baseconfiguration/Definitions/activation-blueprint.json +++ b/ms/controllerblueprints/application/load/blueprints/baseconfiguration/Definitions/activation-blueprint.json @@ -2,7 +2,7 @@ "metadata": { "template_author": "Brinda Santh Muthuramalingam", "author-email": "brindasanth@gmail.com", - "user-groups" : "ADMIN, OPERATION", + "user-groups": "ADMIN, OPERATION", "template_name": "baseconfiguration", "template_version": "1.0.0", "template_tags": "brinda, tosca" @@ -30,9 +30,21 @@ "activate-process": { "type": "bpmn-activate", "properties": { - "process-name": { "get_input" : "action-name" }, - "version" : { "get_property" : ["SELF", "process-name"] }, - "content": { "get_artifact" : ["SELF", "activate-process"] } + "process-name": { + "get_input": "action-name" + }, + "version": { + "get_property": [ + "SELF", + "process-name" + ] + }, + "content": { + "get_artifact": [ + "SELF", + "activate-process" + ] + } }, "artifacts": { "activate-process": { @@ -43,7 +55,7 @@ }, "resource-assignment": { "type": "component-resource-assignment", - "properties":{ + "properties": { "request-id": "1234" }, "interfaces": { @@ -51,12 +63,28 @@ "operations": { "process": { "inputs": { - "action-name": { "get_input" : "action-name" }, + "action-name": { + "get_input": "action-name" + }, "resource-type": "vnf-type", - "request-id": { "get_input" : "request-id" }, - "resource-id": { "get_input" : "hostname" }, - "template-content": { "get_artifact" : ["SELF", "baseconfig-template"] }, - "mapping-content": { "get_artifact" : ["SELF", "baseconfig-mapping"] } + "request-id": { + "get_input": "request-id" + }, + "resource-id": { + "get_input": "hostname" + }, + "template-content": { + "get_artifact": [ + "SELF", + "baseconfig-template" + ] + }, + "mapping-content": { + "get_artifact": [ + "SELF", + "baseconfig-mapping" + ] + } }, "outputs": { "resource-assignment-params": "", @@ -79,18 +107,20 @@ }, "resource-assignment-py": { "type": "component-resource-assignment", - "properties":{ + "properties": { "request-id": "1234" }, "interfaces": { "DefaultComponentNode": { "operations": { "process": { - "implementation" :{ - "primary" : "component-script" + "implementation": { + "primary": "component-script" }, "inputs": { - "action-name": { "get_input" : "action-name" } + "action-name": { + "get_input": "action-name" + } }, "outputs": { "resource-assignment-params": "", @@ -108,37 +138,37 @@ } } }, - "workflows":{ - "activate-process":{ - "steps" : { - "call-resource-assignment" : { - "description" : "Invoke Resource Assignment Component", - "target" : "resource-assignment", - "activities" : [ - { - "call_operation": "ResourceAssignmentNode.process" - } - ], - "on_success" : [ - "download-baseconfig" - ] - }, - "download-baseconfig" : { - "description" : "Call Download Base Config Component", - "target" : "activate-netconf", - "activities" : [ + "workflows": { + "activate-process": { + "steps": { + "call-resource-assignment": { + "description": "Invoke Resource Assignment Component", + "target": "resource-assignment", + "activities": [ + { + "call_operation": "ResourceAssignmentNode.process" + } + ], + "on_success": [ + "download-baseconfig" + ] + }, + "download-baseconfig": { + "description": "Call Download Base Config Component", + "target": "activate-netconf", + "activities": [ { "call_operation": "NetconfTransactionNode.process" } ], - "on_success" : [ + "on_success": [ "download-licence" ] }, - "download-licence" : { - "description" : "Call Download Licence Component", - "target" : "activate-netconf", - "activities" : [ + "download-licence": { + "description": "Call Download Licence Component", + "target": "activate-netconf", + "activities": [ { "call_operation": "NetconfTransactionNode.process" } @@ -214,7 +244,7 @@ "version": { "required": false, "type": "string", - "default" : "LATEST" + "default": "LATEST" } }, "derived_from": "tosca.nodes.DG" @@ -222,74 +252,16 @@ "tosca.nodes.Component": { "description": "This is Resource Assignment Component API", "version": "1.0.0", - "properties": { - "type": { - "description": "Request Id used to store the generated configuration, in the database along with the template-name", - "required": false, - "type": "string" - } - }, - "interfaces": { - "DefaultOperation": { - "operations": { - "validate": { - "inputs": { - "action-name": { - "description": "validate for action", - "required": false, - "type": "string" - } - } - } - } - } - }, - "artifacts" :{ - "component-jar": { - "description": "Component Jar", - "type": "artifact-component-jar", - "file": "Component/basecomponent.jar" - } - }, "derived_from": "tosca.nodes.Root" }, - "tosca.nodes.DG" : { - "description" : "This is Directed Graph Node Type", - "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" }, "tosca.nodes.component.Python": { "description": "This is Resource Assignment Python Component API", "version": "1.0.0", - "properties": { - "type": { - "description": "Request Id used to store the generated configuration, in the database along with the template-name", - "required": false, - "type": "string" - } - }, - "interfaces": { - "DefaultOperation": { - "operations": { - "validate": { - "inputs": { - "action-name": { - "description": "validate for action", - "required": false, - "type": "string" - } - } - } - } - } - }, - "artifacts" :{ - "component-jar": { - "description": "Component Jar", - "type": "artifact-component-jar", - "file": "Component/basecomponent.jar" - } - }, "derived_from": "tosca.nodes.Root" }, "component-resource-assignment": { @@ -392,7 +364,7 @@ } }, "data_types": { - "sample-property" : { + "sample-property": { "description": "This is sample data type", "version": "1.0.0", "properties": { @@ -407,10 +379,10 @@ "version": { "required": false, "type": "string", - "default" : "LATEST" + "default": "LATEST" } }, - "derived_from" : "tosca.datatypes.Root" + "derived_from": "tosca.datatypes.Root" } } } \ No newline at end of file diff --git a/ms/controllerblueprints/application/load/model_type/node_type/component-resource-assignment.json b/ms/controllerblueprints/application/load/model_type/node_type/component-resource-assignment.json index 34c02848..d424a8e4 100644 --- a/ms/controllerblueprints/application/load/model_type/node_type/component-resource-assignment.json +++ b/ms/controllerblueprints/application/load/model_type/node_type/component-resource-assignment.json @@ -7,16 +7,16 @@ } }, "interfaces": { - "org-openecomp-sdnc-config-assignment-service-ConfigAssignmentNode": { + "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": { "operations": { "process": { "inputs": { - "service-template-name": { + "template-name": { "description": "Service Template Name.", "required": true, "type": "string" }, - "service-template-version": { + "template-version": { "description": "Service Template Version.", "required": true, "type": "string" diff --git a/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Definitions/vrr-test.json b/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Definitions/vrr-test.json index 5fe2d251..41f6e92f 100644 --- a/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Definitions/vrr-test.json +++ b/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Definitions/vrr-test.json @@ -3,7 +3,7 @@ "template_author": "Brinda Santh ( bs2796@onap.com )", "template_name": "vrr-test", "template_version": "1.0.0", - "template_tags" : "brinda, VRR", + "template_tags": "brinda, VRR", "release": "201802", "service-type": "AVPN", "vnf-type": "VRR" @@ -172,20 +172,30 @@ "resource-assignment": { "type": "component-resource-assignment", "interfaces": { - "org-openecomp-sdnc-config-assignment-service-ConfigAssignmentNode": { + "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": { "operations": { "process": { "inputs": { - "service-template-name": "{ \"get_attribute\" : \"template_name\" }", - "service-template-version": "{ \"get_attribute\" : \"service-template-version\" }", - "action-name": "{ \"get_input\" : \"action-name\" }", + "template-name": { + "get_input": "template_name" + }, + "template-version": { + "get_input": "template_version" + }, + "action-name": { + "get_input": "action-name" + }, "resource-type": "vnf-type", "template-names": [ "base-config-template", "licence-template" ], - "request-id": "{ \"get_input\" : \"request-id\" }", - "resource-id": "{ \"get_input\" : \"vnf-id\" }" + "request-id": { + "get_input": "request-id" + }, + "resource-id": { + "get_input": "vnf-id" + } }, "outputs": { "resource-assignment-params": "", @@ -205,8 +215,12 @@ "netconf": { "properties": { "profile-name": "sample", - "oam-ipv4-address": "{ \"get_attribute\" : \"hostname\" }", - "port-number": { "get_input" : "host-port" }, + "oam-ipv4-address": { + "get_input": "hostname" + }, + "port-number": { + "get_input": "host-port" + }, "connection-time-out": 30 } } @@ -218,19 +232,29 @@ "org-openecomp-sdnc-netconf-adaptor-service-NetconfExecutorNode": { "operations": { "process": { - "implementation" : { - "primary" : "file://netconf-adaptor/DefaultGetConfig.py" + "implementation": { + "primary": "file://netconf-adaptor/DefaultGetConfig.py" }, "inputs": { - "action-name": "{ \"get_input\" : \"action-name\" }", + "action-name": { + "get_input": "action-name" + }, "resource-type": "vnf-type", - "request-id": "{ \"get_attribute\" : \"request-id\" }", - "resource-id": "{ \"get_input\" : \"vnf-id\" }", + "request-id": { + "get_input": "request-id" + }, + "resource-id": { + "get_input": "vnf-id" + }, "execution-script": "execution-script" }, "outputs": { - "response-data": "{ \"get_attribute\" : \"netconf-executor-baseconfig.response-data\" }", - "status": "{ \"get_attribute\" : \"netconf-executor-baseconfig.status\" }" + "response-data": { + "get_attribute": ["SELF", "netconf-executor-baseconfig.response-data"] + }, + "status": { + "get_attribute": ["SELF", "netconf-executor-baseconfig.status"] + } } } } @@ -311,7 +335,7 @@ } }, "interfaces": { - "org-openecomp-sdnc-config-assignment-service-ConfigAssignmentNode": { + "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": { "operations": { "process": { "inputs": { @@ -320,12 +344,12 @@ "required": true, "type": "string" }, - "service-template-name": { + "template-name": { "description": "Service Template Name.", "required": true, "type": "string" }, - "service-template-version": { + "template-version": { "description": "Service Template Version.", "required": true, "type": "string" @@ -569,12 +593,12 @@ "required": true, "type": "string" }, - "service-template-name": { + "template-name": { "description": "Service Template Name", "required": true, "type": "string" }, - "service-template-version": { + "template-version": { "description": "Service Template Version", "required": true, "type": "string" @@ -617,25 +641,25 @@ }, "derived_from": "tosca.nodes.Component" }, - "tosca.nodes.DG" : { - "description" : "This is Directed Graph Node Type", - "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" }, - "tosca.nodes.Vnf" : { - "description" : "This is VNF Node Type", - "version" : "1.0.0", - "derived_from" : "tosca.nodes.Root" + "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" + "tosca.nodes.Artifact": { + "description": "This is Deprecated Artifact Node Type.", + "version": "1.0.0", + "derived_from": "tosca.nodes.Root" }, - "tosca.nodes.Component" : { - "description" : "This is default Component Node", - "version" : "1.0.0", - "derived_from" : "tosca.nodes.Root" + "tosca.nodes.Component": { + "description": "This is default Component Node", + "version": "1.0.0", + "derived_from": "tosca.nodes.Root" } }, "data_types": { diff --git a/ms/controllerblueprints/modules/service/src/main/resources/service_template/default_netconf.json b/ms/controllerblueprints/modules/service/src/main/resources/service_template/default_netconf.json index 8b1c7909..5b5332fc 100644 --- a/ms/controllerblueprints/modules/service/src/main/resources/service_template/default_netconf.json +++ b/ms/controllerblueprints/modules/service/src/main/resources/service_template/default_netconf.json @@ -13,11 +13,11 @@ "required": true, "type": "string" }, - "service-template-name": { + "template-name": { "required": true, "type": "string" }, - "service-template-version": { + "template-version": { "required": true, "type": "string" }, @@ -146,7 +146,7 @@ "resource-assignment": { "type": "component-resource-assignment", "interfaces": { - "org-openecomp-sdnc-config-assignment-service-ConfigAssignmentNode": { + "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": { "operations": { "process": { "inputs": { @@ -155,8 +155,8 @@ "base-config-template", "licence-template" ], - "request-id": "{ \"get_attribute\" : \"request-id\" }", - "resource-id": "{ \"get_input\" : \"vnf-id\" }" + "request-id": { "get_input" : "request-id" }, + "resource-id": { "get_input" : "vnf-id" } }, "outputs": { "resource-assignment-params": "", @@ -220,10 +220,10 @@ ], "resource-type": "vnf-type", "initialise-sftp": false, - "request-id": "{ \"get_input\" : \"request-id\" }", + "request-id": {"get_input" : "request-id"}, "initialise-ssh": false, - "resource-id": "{ \"get_input\" : \"vnf-id\" }", - "action-name": "{ \"get_input\" : \"action-name\" }" + "resource-id": { "get_input" : "vnf-id" }, + "action-name": {"get_input" : "action-name"} }, "outputs": { "rpc-response-message": "", @@ -400,20 +400,6 @@ "capabilities": { "dg-node": { "type": "tosca.capabilities.Node" - }, - "content": { - "type": "tosca.capabilities.Content", - "properties": { - "type": { - "required": false, - "type": "string", - "default": "json" - }, - "content": { - "required": true, - "type": "string" - } - } } }, "requirements": { @@ -465,20 +451,6 @@ "capabilities": { "dg-node": { "type": "tosca.capabilities.Node" - }, - "content": { - "type": "tosca.capabilities.Content", - "properties": { - "type": { - "required": false, - "type": "string", - "default": "json" - }, - "content": { - "required": true, - "type": "string" - } - } } }, "requirements": { @@ -553,7 +525,7 @@ } }, "interfaces": { - "org-openecomp-sdnc-config-assignment-service-ConfigAssignmentNode": { + "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": { "operations": { "process": { "inputs": { diff --git a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json index d5d3f669..70d03e0a 100644 --- a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json +++ b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json @@ -39,7 +39,12 @@ "login-key": "sdnc", "login-account": "sndc-local", "source": "local", - "target-ip-address": "{\"get_attribute\":\"lo0-local-ipv4-address\"}", + "target-ip-address": { + "get_attribute": [ + "SELF", + "lo0-local-ipv4-address" + ] + }, "port-number": 22, "connection-time-out": 30 } @@ -63,20 +68,40 @@ "operations": { "process": { "inputs": { - "action-name": "{ \"get_input\" : \"action-name\" }", - "template-name": "{ \"get_attribute\" : \"template_name\" }", - "template-version": "{ \"get_attribute\" : \"template_version\" }", + "action-name": { + "get_input": "action-name" + }, + "template-name": { + "get_input": "template_name" + }, + "template-version": { + "get_input": "template_version" + }, "resource-type": "vnf-type", - "request-id": "{ \"get_input\" : \"request-id\" }", - "resource-id": "{ \"get_input\" : \"hostname\" }", + "request-id": { + "get_input": "request-id" + }, + "resource-id": { + "get_input": "hostname" + }, "execution-script": "execution-script" }, "outputs": { - "response-data": "{ \"get_attribute\" : \"netconf-executor-baseconfig.response-data\" }", - "status": "{ \"get_attribute\" : \"netconf-executor-baseconfig.status\" }" + "response-data": { + "get_attribute": [ + "SELF", + "netconf-executor-baseconfig.response-data" + ] + }, + "status": { + "get_attribute": [ + "SELF", + "netconf-executor-baseconfig.status" + ] + } }, - "implementation" : { - "primary" : "file://netconf_adaptor/DefaultBaseLicenceConfig.py" + "implementation": { + "primary": "file://netconf_adaptor/DefaultBaseLicenceConfig.py" } } } @@ -89,7 +114,7 @@ "component-node": {} }, "interfaces": { - "org-openecomp-sdnc-config-assignment-service-ConfigAssignmentNode": { + "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": { "operations": { "process": { "inputs": { @@ -97,12 +122,22 @@ "base-config-template", "licence-template" ], - "action-name": "{ \"get_input\" : \"action-name\" }", - "service-template-name": "{ \"get_attribute\" : \"template_name\" }", - "service-template-version": "{ \"get_attribute\" : \"service-template-version\" }", + "action-name": { + "get_input": "action-name" + }, + "template-name": { + "get_input": "template_name" + }, + "template-version": { + "get_input": "template-version" + }, "resource-type": "vnf-type", - "request-id": "{ \"get_input\" : \"request-id\" }", - "resource-id": "{ \"get_input\" : \"hostname\" }" + "request-id": { + "get_input": "request-id" + }, + "resource-id": { + "get_input": "hostname" + } }, "outputs": { "resource-assignment-params": "success", diff --git a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json index b6898d84..bf3deffb 100644 --- a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json +++ b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json @@ -215,16 +215,16 @@ } }, "interfaces" : { - "org-openecomp-sdnc-config-assignment-service-ConfigAssignmentNode" : { + "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode" : { "operations" : { "process" : { "inputs" : { - "service-template-name" : { + "template-name" : { "description" : "Service Template Name.", "required" : true, "type" : "string" }, - "service-template-version" : { + "template-version" : { "description" : "Service Template Version.", "required" : true, "type" : "string" @@ -535,7 +535,9 @@ "login-key" : "sdnc", "login-account" : "sndc-local", "source" : "local", - "target-ip-address" : "{\"get_attribute\":\"lo0-local-ipv4-address\"}", + "target-ip-address" : { + "get_attribute" : [ "SELF", "lo0-local-ipv4-address" ] + }, "port-number" : 22, "connection-time-out" : 30 } @@ -562,17 +564,31 @@ "primary" : "file://netconf_adaptor/DefaultBaseLicenceConfig.py" }, "inputs" : { - "action-name" : "{ \"get_input\" : \"action-name\" }", - "template-name" : "{ \"get_attribute\" : \"template_name\" }", - "template-version" : "{ \"get_attribute\" : \"template_version\" }", + "action-name" : { + "get_input" : "action-name" + }, + "template-name" : { + "get_input" : "template_name" + }, + "template-version" : { + "get_input" : "template_version" + }, "resource-type" : "vnf-type", - "request-id" : "{ \"get_input\" : \"request-id\" }", - "resource-id" : "{ \"get_input\" : \"hostname\" }", + "request-id" : { + "get_input" : "request-id" + }, + "resource-id" : { + "get_input" : "hostname" + }, "execution-script" : "execution-script" }, "outputs" : { - "response-data" : "{ \"get_attribute\" : \"netconf-executor-baseconfig.response-data\" }", - "status" : "{ \"get_attribute\" : \"netconf-executor-baseconfig.status\" }" + "response-data" : { + "get_attribute" : [ "SELF", "netconf-executor-baseconfig.response-data" ] + }, + "status" : { + "get_attribute" : [ "SELF", "netconf-executor-baseconfig.status" ] + } } } } @@ -585,17 +601,27 @@ "component-node" : { } }, "interfaces" : { - "org-openecomp-sdnc-config-assignment-service-ConfigAssignmentNode" : { + "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode" : { "operations" : { "process" : { "inputs" : { "template-names" : [ "base-config-template", "licence-template" ], - "action-name" : "{ \"get_input\" : \"action-name\" }", - "service-template-name" : "{ \"get_attribute\" : \"template_name\" }", - "service-template-version" : "{ \"get_attribute\" : \"service-template-version\" }", + "action-name" : { + "get_input" : "action-name" + }, + "template-name" : { + "get_input" : "template_name" + }, + "template-version" : { + "get_input" : "template-version" + }, "resource-type" : "vnf-type", - "request-id" : "{ \"get_input\" : \"request-id\" }", - "resource-id" : "{ \"get_input\" : \"hostname\" }" + "request-id" : { + "get_input" : "request-id" + }, + "resource-id" : { + "get_input" : "hostname" + } }, "outputs" : { "resource-assignment-params" : "success",