Add configuration property to load model types and Remove duplicate model type test case files
Change-Id: I6a34539cae7377bd133727fde77ff8fefaadf023
Issue-ID: CCSDK-484
Signed-off-by: Brinda Santh <brindasanth@in.ibm.com>
"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
#
-# Copyright © 2017-2018 AT&T Intellectual Property.
+# Copyright © 2017-2018 AT&T Intellectual Property.
+# Modifications Copyright © 2018 IBM.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#Load Blueprints
# blueprints.load.initial-data may be overridden by ENV variables
blueprints.load.initial-data=true
-blueprints.load.path=load
\ No newline at end of file
+load.dataTypePath=load/model_type/data_type
+load.nodeTypePath=load/model_type/node_type
+load.artifactTypePath=load/model_type/artifact_type
+load.resourceDictionaryPath=load/resource_dictionary
+load.blueprintsPath=load/blueprints
\ No newline at end of file
#\r
-# Copyright © 2017-2018 AT&T Intellectual Property.\r
+# Copyright © 2017-2018 AT&T Intellectual Property.\r
+# Modifications Copyright © 2018 IBM.\r
#\r
# Licensed under the Apache License, Version 2.0 (the "License");\r
# you may not use this file except in compliance with the License.\r
#Load Blueprints\r
# blueprints.load.initial-data may be overridden by ENV variables\r
blueprints.load.initial-data=true\r
-blueprints.load.path=load
\ No newline at end of file
+load.dataTypePath=load/model_type/data_type\r
+load.nodeTypePath=load/model_type/node_type\r
+load.artifactTypePath=load/model_type/artifact_type\r
+load.resourceDictionaryPath=load/resource_dictionary\r
+load.blueprintsPath=load/blueprints
\ No newline at end of file
+++ /dev/null
-{\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
-}
\ No newline at end of file
+++ /dev/null
-{\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
-}
\ No newline at end of file
+++ /dev/null
-{\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
-}
\ No newline at end of file
+++ /dev/null
-{\r
- "version": "1.0.0",\r
- "description": "This is Resource Assignment Data Type",\r
- "properties": {\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
- "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.datatypes.Root"\r
-}
\ No newline at end of file
+++ /dev/null
-{\r
- "version": "1.0.0",\r
- "description": "This is dt-plicense-key Data Type",\r
- "properties": {\r
- "license-key": {\r
- "required": true,\r
- "type": "string"\r
- }\r
- },\r
- "derived_from": "tosca.datatypes.Root"\r
-}
\ No newline at end of file
+++ /dev/null
-{\r
- "version": "1.0.0",\r
- "description": "This is dt-v4-aggregate Data Type",\r
- "properties": {\r
- "ipv4-address": {\r
- "required": true,\r
- "type": "string"\r
- },\r
- "ipv4-plen": {\r
- "required": false,\r
- "type": "integer"\r
- }\r
- },\r
- "derived_from": "tosca.datatypes.Root"\r
-}
\ No newline at end of file
+++ /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.capability.Content",\r
- "properties": {\r
- "content": {\r
- "required": true,\r
- "type": "string"\r
- }\r
- }\r
- },\r
- "mapping": {\r
- "type": "tosca.capability.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
- "org-openecomp-sdnc-config-generator-service-ConfigGeneratorNode": {\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.apps.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
+++ /dev/null
-{\r
- "description": "This is Netconf Edit Configuration Component API",\r
- "version": "1.0.0",\r
- "capabilities": {\r
- "component-node": {\r
- "type": "tosca.capabilities.Node"\r
- }\r
- },\r
- "interfaces": {\r
- "org-openecomp-sdnc-netconf-adaptor-service-SimpleNetconfEditConfigNode": {\r
- "operations": {\r
- "process": {\r
- "inputs": {\r
- "template-name": {\r
- "description": "Template name used by the Components during processing",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "rpc-message": {\r
- "description": "If the message is Neconf RPC message,It should be true or false.",\r
- "required": false,\r
- "type": "boolean",\r
- "default": false\r
- },\r
- "wait": {\r
- "description": "Delay time in sec before performing edit-config action.",\r
- "required": false,\r
- "type": "integer",\r
- "default": 0\r
- },\r
- "unlock": {\r
- "description": "If unLock command has to send before Edit Configuration.",\r
- "required": false,\r
- "type": "boolean",\r
- "default": false\r
- },\r
- "config-target": {\r
- "required": false,\r
- "type": "string"\r
- },\r
- "commit": {\r
- "description": "Issue commit command to the device after performing edit-config action.",\r
- "required": false,\r
- "type": "boolean",\r
- "default": false\r
- },\r
- "edit-default-operation": {\r
- "required": false,\r
- "type": "string"\r
- },\r
- "content": {\r
- "description": "Static messgae content, If this is not set, need to have Requirement relationship to Artifact contents.",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "lock": {\r
- "description": "Issue lock command to the device before performing edit-config action.",\r
- "required": false,\r
- "type": "boolean",\r
- "default": false\r
- },\r
- "post-restart-wait": {\r
- "description": "If Restart command should be issued before the Edit Operation, Provide the time to wait after restart. 0 meanno restart required or wait time in sec ex : 3000 for 5 ",\r
- "required": false,\r
- "type": "integer",\r
- "default": 0\r
- },\r
- "pre-restart-wait": {\r
- "description": "If Restart command should be issued after the Edit Operation, Provide the time to wait after restart. 0 meanno restart required or wait time in sec ex : 3000 for 5 ",\r
- "required": false,\r
- "type": "integer",\r
- "default": 0\r
- },\r
- "message-time-out": {\r
- "required": false,\r
- "type": "integer",\r
- "default": 30\r
- }\r
- },\r
- "outputs": {\r
- "rpc-response-message": {\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
+++ /dev/null
-{\r
- "description": "This is Netconf Transaction Configuration Component API",\r
- "version": "1.0.0",\r
- "capabilities": {\r
- "component-node": {\r
- "type": "tosca.capabilities.Node"\r
- }\r
- },\r
- "requirements": {\r
- "netconf-connection": {\r
- "capability": "netconf",\r
- "node": "vnf-netconf-device",\r
- "relationship": "tosca.relationships.ConnectsTo"\r
- }\r
- },\r
- "interfaces": {\r
- "org-openecomp-sdnc-netconf-adaptor-service-NetconfExecutorNode": {\r
- "operations": {\r
- "process": {\r
- "inputs": {\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
- "template-name": {\r
- "description": "Service Template Name",\r
- "required": true,\r
- "type": "string"\r
- },\r
- "template-version": {\r
- "description": "Service Template Version",\r
- "required": true,\r
- "type": "string"\r
- },\r
- "action-name": {\r
- "description": "Action Name to get from Database, Either (message & mask-info ) or ( resource-id & resource-type & action-name & template-name ) should be present. Message will be given higest priority",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "resource-type": {\r
- "description": "Resource Type to get from Database, Either (message & mask-info ) or( resource-id & resource-type & action-name & template-name ) should be present. Message will be given higest priority",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "resource-id": {\r
- "description": "Resource Id to get from Database, Either (message & mask-info ) or ( resource-id & resource-type & action-name & template-name ) should be present. Message will be given higest priority",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "reservation-id": {\r
- "description": "Reservation Id used to send to NPM",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "execution-script": {\r
- "description": "Python Script to Execute for this Component action, It should refer any one of Prython Artifact Definition for this Node Template.",\r
- "required": true,\r
- "type": "string"\r
- }\r
- },\r
- "outputs": {\r
- "response-data": {\r
- "description": "Execution Response Data in JSON format.",\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
+++ /dev/null
-{\r
- "description": "This is Netconf Get Running Configuration Component API",\r
- "version": "1.0.0",\r
- "capabilities": {\r
- "component-node": {\r
- "type": "tosca.capabilities.Node"\r
- }\r
- },\r
- "interfaces": {\r
- "org-openecomp-sdnc-netconf-adaptor-service-SimpleNetconfGetConfigNode": {\r
- "operations": {\r
- "process": {\r
- "inputs": {\r
- "template-name": {\r
- "description": "Template name used by the Components during processing",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "rpc-message": {\r
- "description": "It should be true, If the message is Neconf RPC message, It should be false If it is plain Config message.",\r
- "required": false,\r
- "type": "boolean",\r
- "default": false\r
- },\r
- "wait": {\r
- "required": false,\r
- "type": "integer",\r
- "default": 0\r
- },\r
- "lock": {\r
- "required": false,\r
- "type": "boolean",\r
- "default": false\r
- },\r
- "content": {\r
- "description": "Static messgae content, If this is not set, need to have Requirement relationship to Artifact contents.",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "message-time-out": {\r
- "required": false,\r
- "type": "integer",\r
- "default": 30\r
- }\r
- },\r
- "outputs": {\r
- "config-message": {\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
+++ /dev/null
-{\r
- "description": "This is Resource Assignment Component API",\r
- "version": "1.0.0",\r
- "capabilities": {\r
- "component-node": {\r
- "type": "tosca.capabilities.Node"\r
- }\r
- },\r
- "interfaces": {\r
- "org-openecomp-sdnc-config-assignment-service-ConfigAssignmentNode": {\r
- "operations": {\r
- "process": {\r
- "inputs": {\r
- "service-template-name": {\r
- "description": "Service Template Name.",\r
- "required": true,\r
- "type": "string"\r
- },\r
- "service-template-version": {\r
- "description": "Service Template Version.",\r
- "required": true,\r
- "type": "string"\r
- },\r
- "resource-type": {\r
- "description": "Request type.",\r
- "required": true,\r
- "type": "string"\r
- },\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
- "resource-id": {\r
- "description": "Resource Id.",\r
- "required": true,\r
- "type": "string"\r
- },\r
- "action-name": {\r
- "description": "Action Name of the process",\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
-}
\ No newline at end of file
+++ /dev/null
-{\r
- "description": "This is Netconf Transaction Configuration Component API",\r
- "version": "1.0.0",\r
- "capabilities": {\r
- "component-node": {\r
- "type": "tosca.capabilities.Node"\r
- }\r
- },\r
- "requirements": {\r
- "netconf-connection": {\r
- "capability": "netconf",\r
- "node": "vnf-netconf-device",\r
- "relationship": "tosca.relationships.ConnectsTo"\r
- }\r
- },\r
- "interfaces": {\r
- "org-openecomp-sdnc-netconf-adaptor-service-NetconfTransactionNode": {\r
- "operations": {\r
- "process": {\r
- "inputs": {\r
- "rollback": {\r
- "required": false,\r
- "type": "boolean"\r
- },\r
- "assignment-action-name": {\r
- "description": "Assignment 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": true,\r
- "type": "string"\r
- },\r
- "transaction-components": {\r
- "description": "Components used to used for the atomic transaction, Default Handlers are org.openecomp.sdnc.netconf.adaptor.service.SimpleNetconfEditConfigNode and org.openecomp.sdnc.netconf.adaptor.service.SimpleNetconfGetConfigNode",\r
- "required": true,\r
- "type": "list",\r
- "entry_schema": {\r
- "type": "string"\r
- }\r
- },\r
- "resource-type": {\r
- "description": "Resource Type to get from Database, Either (message & mask-info ) or( resource-id & resource-type & action-name & template-name ) should be present. Message will be given higest priority",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "initialise-sftp": {\r
- "required": false,\r
- "type": "boolean"\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
- "initialise-ssh": {\r
- "required": false,\r
- "type": "boolean"\r
- },\r
- "lock": {\r
- "required": false,\r
- "type": "boolean",\r
- "default": false\r
- },\r
- "unlock": {\r
- "description": "If unLock command has to send before Edit Configuration.",\r
- "required": false,\r
- "type": "boolean",\r
- "default": false\r
- },\r
- "resource-id": {\r
- "description": "Resource Id to get from Database, Either (message & mask-info ) or ( resource-id & resource-type & action-name & template-name ) should be present. Message will be given higest priority",\r
- "required": false,\r
- "type": "string"\r
- },\r
- "action-name": {\r
- "description": "Action Name to get from Database, Either (message & mask-info ) or ( resource-id & resource-type & action-name & template-name ) should be present. Message will be given higest priority",\r
- "required": false,\r
- "type": "string"\r
- }\r
- },\r
- "outputs": {\r
- "rpc-response-message": {\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
+++ /dev/null
-{
- "description": "This is Download Netconf Directed Graph",
- "version": "1.0.0",
- "properties": {
- "mode": {
- "required": false,
- "type": "string",
- "default": "sync"
- },
- "version": {
- "required": false,
- "type": "string",
- "default": "LATEST"
- },
- "is-start-flow": {
- "required": false,
- "type": "boolean",
- "default": false
- }
- },
- "capabilities": {
- "dg-node": {
- "type": "tosca.capabilities.Node"
- },
- "content": {
- "type": "tosca.capability.Content",
- "properties": {
- "type": {
- "required": false,
- "type": "string",
- "default": "json"
- },
- "content": {
- "required": true,
- "type": "string"
- }
- }
- }
- },
- "requirements": {
- "component-dependency": {
- "capability": "component-node",
- "node": "component-netconf-executor",
- "relationship": "tosca.relationships.DependsOn"
- }
- },
- "interfaces": {
- "CONFIG": {
- "operations": {
- "ActivateNetconf": {
- "inputs": {
- "params": {
- "required": false,
- "type": "list",
- "entry_schema": {
- "type": "datatype-property"
- }
- }
- }
- }
- }
- }
- },
-
- "derived_from": "tosca.nodes.DG"
-}
\ No newline at end of file
+++ /dev/null
-{\r
- "description": "This is Activate DG for Config Generator Directed Graph",\r
- "version": "1.0.0",\r
- "properties": {\r
- "mode": {\r
- "required": false,\r
- "type": "string",\r
- "default": "sync"\r
- },\r
- "version": {\r
- "required": false,\r
- "type": "string",\r
- "default": "LATEST"\r
- },\r
- "is-start-flow": {\r
- "required": false,\r
- "type": "boolean",\r
- "default": false\r
- }\r
- },\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": true,\r
- "type": "string"\r
- }\r
- }\r
- }\r
- },\r
- "requirements": {\r
- "component-dependency": {\r
- "capability": "component-node",\r
- "node": "component-config-generator",\r
- "relationship": "tosca.relationships.DependsOn"\r
- }\r
- },\r
- "interfaces": {\r
- "CONFIG": {\r
- "operations": {\r
- "GenerateConfiguration": {\r
- "inputs": {\r
- "params": {\r
- "required": false,\r
- "type": "list",\r
- "entry_schema": {\r
- "type": "datatype-property"\r
- }\r
- }\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "derived_from": "tosca.nodes.DG"\r
-}
\ No newline at end of file
+++ /dev/null
-{\r
- "description": "This is Resource Assign and Activate Netconf Directed Graph",\r
- "version": "1.0.0",\r
- "properties": {\r
- "mode": {\r
- "required": false,\r
- "type": "string",\r
- "default": "sync"\r
- },\r
- "version": {\r
- "required": false,\r
- "type": "string",\r
- "default": "LATEST"\r
- },\r
- "is-start-flow": {\r
- "required": false,\r
- "type": "boolean",\r
- "default": false\r
- }\r
- },\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
- "ra-component": {\r
- "capability": "component-node",\r
- "node": "component-resource-assignment",\r
- "relationship": "tosca.relationships.DependsOn"\r
- },\r
- "netconf-component": {\r
- "capability": "component-node",\r
- "node": "component-netconf-executor",\r
- "relationship": "tosca.relationships.DependsOn"\r
- }\r
- },\r
- "interfaces": {\r
- "CONFIG": {\r
- "operations": {\r
- "ResourceAssignAndActivate": {\r
- "inputs": {\r
- "params": {\r
- "required": false,\r
- "type": "list",\r
- "entry_schema": {\r
- "type": "datatype-property"\r
- }\r
- }\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "derived_from": "tosca.nodes.DG"\r
-}
\ No newline at end of file
+++ /dev/null
-{\r
- "description": "This is Resource Assignment Directed Graph",\r
- "version": "1.0.0",\r
- "properties": {\r
- "mode": {\r
- "required": false,\r
- "type": "string",\r
- "default": "sync"\r
- },\r
- "version": {\r
- "required": false,\r
- "type": "string",\r
- "default": "LATEST"\r
- },\r
- "is-start-flow": {\r
- "required": false,\r
- "type": "boolean",\r
- "default": false\r
- }\r
- },\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
- "CONFIG": {\r
- "operations": {\r
- "ResourceAssignment": {\r
- "inputs": {\r
- "params": {\r
- "required": false,\r
- "type": "list",\r
- "entry_schema": {\r
- "type": "datatype-property"\r
- }\r
- }\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "derived_from": "tosca.nodes.DG"\r
-}
\ No newline at end of file
+++ /dev/null
-{
- "description": "This is Database Resource Source Node Type",
- "version": "1.0.0",
- "properties": {
- "type": {
- "required": true,
- "type": "string",
- "constraints": [
- {
- "valid_values": [
- "SQL",
- "PLSQL"
- ]
- }
- ]
- },
- "query": {
- "required": true,
- "type": "string"
- },
- "input-key-mapping": {
- "required": false,
- "type": "map",
- "entry_schema": {
- "type": "string"
- }
- },
- "output-key-mapping": {
- "required": false,
- "type": "map",
- "entry_schema": {
- "type": "string"
- }
- },
- "key-dependencies": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- }
- },
- "derived_from": "tosca.nodes.ResourceSource"
-}
\ No newline at end of file
+++ /dev/null
-{
- "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"
- }
- }
- },
- "derived_from": "tosca.nodes.ResourceSource"
-}
\ No newline at end of file
+++ /dev/null
-{
- "description": "This is Input Resource Source Node Type",
- "version": "1.0.0",
- "properties": {
- "key": {
- "required": false,
- "type": "string"
- },
- "key-dependencies": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- }
- },
- "derived_from": "tosca.nodes.ResourceSource"
-}
\ No newline at end of file
+++ /dev/null
-{
- "description": "This is Rest Resource Source Node Type",
- "version": "1.0.0",
- "properties": {
- "type": {
- "required": false,
- "type": "string",
- "default": "JSON",
- "constraints": [
- {
- "valid_values": [
- "JSON"
- ]
- }
- ]
- },
- "url-path": {
- "required": true,
- "type": "string"
- },
- "path": {
- "required": true,
- "type": "string"
- },
- "expression-type": {
- "required": false,
- "type": "string",
- "default": "JSON_PATH",
- "constraints": [
- {
- "valid_values": [
- "JSON_PATH",
- "JSON_POINTER"
- ]
- }
- ]
- },
- "input-key-mapping": {
- "required": false,
- "type": "map",
- "entry_schema": {
- "type": "string"
- }
- },
- "output-key-mapping": {
- "required": false,
- "type": "map",
- "entry_schema": {
- "type": "string"
- }
- },
- "key-dependencies": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- }
- },
- "derived_from": "tosca.nodes.ResourceSource"
-}
\ No newline at end of file
+++ /dev/null
-{
- "description": "TOSCA base type for Resource Sources",
- "version": "1.0.0",
- "derived_from": "tosca.nodes.Root"
-}
\ No newline at end of file
+++ /dev/null
-{\r
- "description": "This is VNF Device with Netconf Capability",\r
- "version": "1.0.0",\r
- "capabilities": {\r
- "netconf": {\r
- "type": "tosca.capability.Netconf",\r
- "properties": {\r
- "login-key": {\r
- "required": true,\r
- "type": "string",\r
- "default": "sdnc"\r
- },\r
- "login-account": {\r
- "required": true,\r
- "type": "string",\r
- "default": "sdnc-tacacs"\r
- },\r
- "source": {\r
- "required": true,\r
- "type": "string",\r
- "default": "npm"\r
- },\r
- "target-ip-address": {\r
- "required": true,\r
- "type": "string"\r
- },\r
- "port-number": {\r
- "required": true,\r
- "type": "integer",\r
- "default": 830\r
- },\r
- "connection-time-out": {\r
- "required": false,\r
- "type": "integer",\r
- "default": 30\r
- }\r
- }\r
- }\r
- },\r
- "derived_from": "tosca.nodes.Vnf"\r
- \r
-}\r
public class DataBaseInitService {\r
\r
private static EELFLogger log = EELFManager.getInstance().getLogger(DataBaseInitService.class);\r
- @Value("${blueprints.load.path}")\r
- private String modelLoadPath;\r
private ModelTypeService modelTypeService;\r
private ResourceDictionaryService resourceDictionaryService;\r
private ConfigModelService configModelService;\r
\r
+ @Value("${load.dataTypePath}")\r
private String dataTypePath;\r
+ @Value("${load.nodeTypePath}")\r
private String nodeTypePath;\r
+ @Value("${load.artifactTypePath}")\r
private String artifactTypePath;\r
+ @Value("${load.resourceDictionaryPath}")\r
private String resourceDictionaryPath;\r
+ @Value("${load.blueprintsPath}")\r
private String bluePrintsPath;\r
\r
@Autowired\r
@PostConstruct\r
@SuppressWarnings("unused")\r
private void initDatabase() {\r
- log.info("loading Blueprints from DIR : {}", modelLoadPath);\r
- dataTypePath = modelLoadPath + "/model_type/data_type";\r
- nodeTypePath = modelLoadPath + "/model_type/node_type";\r
- artifactTypePath = modelLoadPath + "/model_type/artifact_type";\r
- resourceDictionaryPath = modelLoadPath + "/resource_dictionary";\r
- bluePrintsPath = modelLoadPath + "/blueprints";\r
-\r
log.info("loading dataTypePath from DIR : {}", dataTypePath);\r
log.info("loading nodeTypePath from DIR : {}", nodeTypePath);\r
log.info("loading artifactTypePath from DIR : {}", artifactTypePath);\r
import reactor.core.publisher.Flux
import reactor.core.publisher.Mono
import reactor.core.scheduler.Schedulers
+
/**
* ResourceDictionaryReactRepository.
*
@Service
open class ResourceDictionaryReactRepository(private val resourceDictionaryRepository: ResourceDictionaryRepository) {
+ fun save(resourceDictionary: ResourceDictionary): Mono<ResourceDictionary> {
+ return Mono.justOrEmpty(resourceDictionaryRepository.save(resourceDictionary))
+ }
+
fun findByName(name: String): Mono<ResourceDictionary> {
return Mono.justOrEmpty(resourceDictionaryRepository.findByName(name))
}
package org.onap.ccsdk.apps.controllerblueprints.service.repository;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;
import org.onap.ccsdk.apps.controllerblueprints.TestApplication;
+import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils;
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceDefinition;
import org.onap.ccsdk.apps.controllerblueprints.service.domain.ResourceDictionary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import java.util.Arrays;
import java.util.List;
+
/**
* ResourceDictionaryReactRepositoryTest.
*
@Autowired
protected ResourceDictionaryReactRepository resourceDictionaryReactRepository;
+ @Before
+ public void init() {
+ ResourceDefinition resourceDefinition = JacksonUtils.readValueFromFile("load/resource_dictionary/db-source" +
+ ".json", ResourceDefinition.class);
+
+ ResourceDictionary resourceDictionary = transformResourceDictionary(resourceDefinition);
+ ResourceDictionary dbResourceDictionary = resourceDictionaryReactRepository.save(resourceDictionary).block();
+ Assert.assertNotNull("Failed to query React Resource Dictionary by Name", dbResourceDictionary);
+ }
+
@Test
public void test01FindByNameReact() throws Exception {
ResourceDictionary dbResourceDictionary = resourceDictionaryReactRepository.findByName("db-source").block();
resourceDictionaryReactRepository.findByTagsContainingIgnoreCase("db-source").collectList().block();
Assert.assertNotNull("Failed to query React Resource Dictionary by Tags", dbTagsResourceDictionaries);
}
+
+ private ResourceDictionary transformResourceDictionary(ResourceDefinition resourceDefinition) {
+ ResourceDictionary resourceDictionary = new ResourceDictionary();
+ resourceDictionary.setName(resourceDefinition.getName());
+ resourceDictionary.setDataType(resourceDefinition.getProperty().getType());
+ resourceDictionary.setDescription(resourceDefinition.getProperty().getDescription());
+ resourceDictionary.setResourcePath(resourceDefinition.getResourcePath());
+ resourceDictionary.setResourceType(resourceDefinition.getResourceType());
+ resourceDictionary.setTags(resourceDefinition.getTags());
+ resourceDictionary.setUpdatedBy(resourceDefinition.getUpdatedBy());
+ resourceDictionary.setDefinition(resourceDefinition);
+ return resourceDictionary;
+ }
}
/*\r
* Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
\r
\r
@After\r
- public void tearDown() {}\r
+ public void tearDown() {\r
+ }\r
\r
@Test\r
public void test01SaveModelType() throws Exception {\r
- log.info( "**************** test01SaveModelType ********************");\r
+ log.info("**************** test01SaveModelType ********************");\r
\r
- String content = FileUtils.readFileToString(new File("load/model_type/data_type/datatype-property.json"), Charset.defaultCharset());\r
+ String content = JacksonUtils.getClassPathFileContent("model_type/data_type/datatype-property.json");\r
ModelType modelType = new ModelType();\r
modelType.setDefinitionType(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE);\r
modelType.setDerivedFrom(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT);\r
+ BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE);\r
modelType.setUpdatedBy("xxxxxx@xxx.com");\r
modelType = modelTypeRest.saveModelType(modelType);\r
- log.info( "Saved Mode {}", modelType.toString());\r
+ log.info("Saved Mode {}", modelType.toString());\r
Assert.assertNotNull("Failed to get Saved ModelType", modelType);\r
Assert.assertNotNull("Failed to get Saved ModelType, Id", modelType.getModelName());\r
\r
\r
@Test\r
public void test02SearchModelTypes() throws Exception {\r
- log.info( "*********************** test02SearchModelTypes ***************************");\r
+ log.info("*********************** test02SearchModelTypes ***************************");\r
\r
String tags = "test-datatype";\r
\r
\r
@Test\r
public void test03GetModelType() throws Exception {\r
- log.info( "************************* test03GetModelType *********************************");\r
+ log.info("************************* test03GetModelType *********************************");\r
ModelType dbModelType = modelTypeRest.getModelTypeByName(modelName);\r
Assert.assertNotNull("Failed to get response for api call getModelByName ", dbModelType);\r
Assert.assertNotNull("Failed to get Id for api call getModelByName ", dbModelType.getModelName());\r
}\r
\r
\r
-\r
}\r
/*\r
* Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
public void test05AutoMap() throws Exception {\r
log.info("*********** test05AutoMap *******************************************");\r
\r
- String resourceassignmentContent = FileUtils.readFileToString(\r
+ String resourceAssignmentContent = FileUtils.readFileToString(\r
new File("src/test/resources/resourcedictionary/automap.json"), Charset.defaultCharset());\r
List<ResourceAssignment> batchResourceAssignment =\r
- JacksonUtils.getListFromJson(resourceassignmentContent, ResourceAssignment.class);\r
+ JacksonUtils.getListFromJson(resourceAssignmentContent, ResourceAssignment.class);\r
AutoMapResponse autoMapResponse = serviceTemplateRest.autoMap(batchResourceAssignment);\r
\r
Assert.assertNotNull("Failed to get ResourceAssignments, Return object is Null",\r
#
-# Copyright © 2017-2018 AT&T Intellectual Property.
+# Copyright © 2017-2018 AT&T Intellectual Property.
+# Modifications Copyright © 2018 IBM.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
blueprints.load.initial-data=true
-blueprints.load.path=load
\ No newline at end of file
+load.dataTypePath=./../../application/load/model_type/data_type
+load.nodeTypePath=./../../application/load/model_type/node_type
+load.artifactTypePath=./../../application/load/model_type/artifact_type
+load.resourceDictionaryPath=load/resource_dictionary
+load.blueprintsPath=./../../application/load/blueprints
\ No newline at end of file