Merge "Resource Resolution Service : 2"
authorDan Timoney <dtimoney@att.com>
Wed, 16 Jan 2019 20:14:04 +0000 (20:14 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 16 Jan 2019 20:14:04 +0000 (20:14 +0000)
48 files changed:
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintConstants.kt
components/core/src/test/resources/dictionary/dictionary_schema.json
components/model-catalog/blueprint-model/service-blueprint/vFW/Definitions/vFW_spinup.json
components/model-catalog/resource-dictionary/starter-dictionary/nf-role.json
components/model-catalog/resource-dictionary/starter-dictionary/nfc-naming-code.json
components/model-catalog/resource-dictionary/starter-dictionary/onap_private_net_cidr.json
components/model-catalog/resource-dictionary/starter-dictionary/primary-db-source.json [moved from components/model-catalog/resource-dictionary/starter-dictionary/db-source.json with 85% similarity, mode: 0644]
components/model-catalog/resource-dictionary/starter-dictionary/private-prefix-id.json
components/model-catalog/resource-dictionary/starter-dictionary/protected-prefix-id.json
components/model-catalog/resource-dictionary/starter-dictionary/protected_private_net_cidr.json
components/model-catalog/resource-dictionary/starter-dictionary/sample-primary-db-source.json [moved from components/model-catalog/resource-dictionary/starter-dictionary/sample-db-source.json with 79% similarity]
components/model-catalog/resource-dictionary/starter-dictionary/unprotected-prefix-id.json
components/model-catalog/resource-dictionary/starter-dictionary/unprotected_private_net_cidr.json
components/model-catalog/resource-dictionary/starter-dictionary/vf-module-label.json
components/model-catalog/resource-dictionary/starter-dictionary/vf-module-type.json
components/model-catalog/resource-dictionary/starter-dictionary/vf-naming-policy.json
components/model-catalog/resource-dictionary/starter-dictionary/vf-nf-code.json
components/model-catalog/resource-dictionary/starter-dictionary/vfccustomizationuuid.json
components/model-catalog/resource-dictionary/starter-dictionary/vm-type.json
components/model-catalog/resource-dictionary/starter-dictionary/vnfc-model-invariant-uuid.json
components/model-catalog/resource-dictionary/starter-dictionary/vnfc-model-version.json
components/resource-dict/load/model_type/node_type/source-primary-db.json [moved from components/resource-dict/load/model_type/node_type/source-db.json with 100% similarity]
components/resource-dict/load/resource_dictionary/nf-role.json
components/resource-dict/load/resource_dictionary/nfc-naming-code.json
components/resource-dict/load/resource_dictionary/onap_private_net_cidr.json
components/resource-dict/load/resource_dictionary/primary-db-source.json [moved from components/resource-dict/load/resource_dictionary/db-source.json with 82% similarity]
components/resource-dict/load/resource_dictionary/private-prefix-id.json
components/resource-dict/load/resource_dictionary/protected-prefix-id.json
components/resource-dict/load/resource_dictionary/protected_private_net_cidr.json
components/resource-dict/load/resource_dictionary/unprotected-prefix-id.json
components/resource-dict/load/resource_dictionary/unprotected_private_net_cidr.json
components/resource-dict/load/resource_dictionary/vf-module-label.json
components/resource-dict/load/resource_dictionary/vf-module-type.json
components/resource-dict/load/resource_dictionary/vf-naming-policy.json
components/resource-dict/load/resource_dictionary/vf-nf-code.json
components/resource-dict/load/resource_dictionary/vfccustomizationuuid.json
components/resource-dict/load/resource_dictionary/vm-type.json
components/resource-dict/load/resource_dictionary/vnfc-model-invariant-uuid.json
components/resource-dict/load/resource_dictionary/vnfc-model-version.json
components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDictionaryConstants.kt
components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceAssignmentUtils.kt [new file with mode: 0644]
components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDefinitionTest.java
components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/factory/ResourceSourceMappingFactoryTest.java
components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationServiceTest.java
components/resource-dict/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceDictionaryTestUtils.kt [moved from components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceDictionaryTestUtils.kt with 90% similarity]
components/resource-dict/src/test/resources/validation/cyclic.json
components/resource-dict/src/test/resources/validation/duplicate.json
components/resource-dict/src/test/resources/validation/success.json

index 102e2eb..4c2d6e2 100644 (file)
-/*\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
- * You may obtain a copy of the License at\r
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-package org.onap.ccsdk.apps.controllerblueprints.core\r
-\r
-/**\r
- * BluePrintConstants\r
- *\r
- * @author Brinda Santh\r
- */\r
-object BluePrintConstants {\r
-\r
-    const val RESPONSE_HEADER_TRANSACTION_ID: String = "X-ONAP-RequestID"\r
-    const val RESPONSE_HEADER_MINOR_VERSION: String = "X-MinorVersion"\r
-    const val RESPONSE_HEADER_PATCH_VERSION: String = "X-PatchVersion"\r
-    const val RESPONSE_HEADER_LATEST_VERSION: String = "X-LatestVersion"\r
-\r
-    const val STATUS_SUCCESS: String = "success"\r
-    const val STATUS_FAILURE: String = "failure"\r
-\r
-    const val TYPE_DEFAULT: String = "default"\r
-\r
-    const val DATA_TYPE_STRING: String = "string"\r
-    const val DATA_TYPE_INTEGER: String = "integer"\r
-    const val DATA_TYPE_FLOAT: String = "float"\r
-    const val DATA_TYPE_BOOLEAN: String = "boolean"\r
-    const val DATA_TYPE_TIMESTAMP: String = "timestamp"\r
-    const val DATA_TYPE_NULL: String = "null"\r
-    const val DATA_TYPE_LIST: String = "list"\r
-    const val DATA_TYPE_MAP: String = "map"\r
-\r
-    const val USER_SYSTEM: String = "System"\r
-\r
-    const val PATH_DIVIDER: String = "/"\r
-    const val PATH_SERVICE_TEMPLATE: String = "service_template"\r
-    const val PATH_TOPOLOGY_TEMPLATE: String = "topology_template"\r
-    const val PATH_METADATA: String = "metadata"\r
-    const val PATH_NODE_TYPES: String = "node_types"\r
-    const val PATH_POLICY_TYPES: String = "policy_types"\r
-    const val PATH_RELATIONSHIP_TYPES: String = "relationship_types"\r
-    const val PATH_ARTIFACT_TYPES: String = "artifact_types"\r
-    const val PATH_DATA_TYPES: String = "data_types"\r
-    const val PATH_INPUTS: String = "inputs"\r
-    const val PATH_NODE_WORKFLOWS: String = "workflows"\r
-    const val PATH_NODE_TEMPLATES: String = "node_templates"\r
-    const val PATH_CAPABILITIES: String = "capabilities"\r
-    const val PATH_REQUIREMENTS: String = "requirements"\r
-    const val PATH_INTERFACES: String = "interfaces"\r
-    const val PATH_OPERATIONS: String = "operations"\r
-    const val PATH_OUTPUTS: String = "outputs"\r
-    const val PATH_PROPERTIES: String = "properties"\r
-    const val PATH_ATTRIBUTES: String = "attributes"\r
-    const val PATH_ARTIFACTS: String = "artifacts"\r
-\r
-    const val MODEL_DIR_MODEL_TYPE: String = "definition-type"\r
-\r
-    const val MODEL_DEFINITION_TYPE_NODE_TYPE: String = "node_type"\r
-    const val MODEL_DEFINITION_TYPE_ARTIFACT_TYPE: String = "artifact_type"\r
-    const val MODEL_DEFINITION_TYPE_CAPABILITY_TYPE: String = "capability_type"\r
-    const val MODEL_DEFINITION_TYPE_RELATIONSHIP_TYPE: String = "relationship_type"\r
-    const val MODEL_DEFINITION_TYPE_DATA_TYPE: String = "data_type"\r
-\r
-    const val MODEL_TYPE_DATATYPES_ROOT: String = "tosca.datatypes.Root"\r
-    const val MODEL_TYPE_NODES_ROOT: String = "tosca.nodes.Root"\r
-    const val MODEL_TYPE_GROUPS_ROOT: String = "tosca.groups.Root"\r
-    const val MODEL_TYPE_RELATIONSHIPS_ROOT: String = "tosca.relationships.Root"\r
-    const val MODEL_TYPE_ARTIFACTS_ROOT: String = "tosca.artifacts.Root"\r
-    const val MODEL_TYPE_CAPABILITIES_ROOT: String = "tosca.capabilities.Root"\r
-    const val MODEL_TYPE_INTERFACES_ROOT: String = "tosca.interfaces.Root"\r
-\r
-    const val MODEL_TYPE_RELATIONSHIPS_DEPENDS_ON = "tosca.relationships.DependsOn"\r
-    const val MODEL_TYPE_RELATIONSHIPS_HOSTED_ON = "tosca.relationships.HostedOn"\r
-    const val MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO = "tosca.relationships.ConnectsTo"\r
-    const val MODEL_TYPE_RELATIONSHIPS_ATTACH_TO = "tosca.relationships.AttachesTo"\r
-    const val MODEL_TYPE_RELATIONSHIPS_ROUTES_TO = "tosca.relationships.RoutesTo"\r
-\r
-    const val MODEL_TYPE_NODE_DG = "tosca.nodes.DG"\r
-    const val MODEL_TYPE_NODE_COMPONENT = "tosca.nodes.Component"\r
-    const val MODEL_TYPE_NODE_VNF = "tosca.nodes.Vnf"\r
-    @Deprecated("Artifacts will be attached to Node Template")\r
-    const val MODEL_TYPE_NODE_ARTIFACT = "tosca.nodes.Artifact"\r
-    const val MODEL_TYPE_NODE_RESOURCE_SOURCE = "tosca.nodes.ResourceSource"\r
-\r
-    const val MODEL_TYPE_NODES_COMPONENT_JAVA: String = "tosca.nodes.component.Java"\r
-    const val MODEL_TYPE_NODES_COMPONENT_BUNDLE: String = "tosca.nodes.component.Bundle"\r
-    const val MODEL_TYPE_NODES_COMPONENT_SCRIPT: String = "tosca.nodes.component.Script"\r
-    const val MODEL_TYPE_NODES_COMPONENT_PYTHON: String = "tosca.nodes.component.Python"\r
-    const val MODEL_TYPE_NODES_COMPONENT_JYTHON: String = "tosca.nodes.component.Jython"\r
-    const val MODEL_TYPE_NODES_COMPONENT_JAVA_SCRIPT: String = "tosca.nodes.component.JavaScript"\r
-\r
-    const val MODEL_TYPE_ARTIFACT_TYPE_IMPLEMENTATION = "tosca.artifacts.Implementation"\r
-\r
-    const val MODEL_TYPE_DATA_TYPE_DYNAMIC = "tosca.datatypes.Dynamic"\r
-\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_NODE = "tosca.capabilities.Node"\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_COMPUTE = "tosca.capabilities.Compute"\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_NETWORK = "tosca.capabilities.Network"\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_STORAGE = "tosca.capabilities.Storage"\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT = "tosca.capabilities.Endpoint"\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT_PUBLIC = "tosca.capabilities.Endpoint.Public"\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT_ADMIN = "tosca.capabilities.Endpoint.Admin"\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT_DATABASE = "tosca.capabilities.Endpoint.Database"\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_ATTACHMENT = "tosca.capabilities.Attachment"\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_OPERATION_SYSTEM = "tosca.capabilities.OperatingSystem"\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_BINDABLE = "tosca.capabilities.network.Bindable"\r
-    // Custom capabilities\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_CONTENT = "tosca.capabilities.Content"\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_MAPPING = "tosca.capabilities.Mapping"\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_NETCONF = "tosca.capabilities.Netconf"\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_SSH = "tosca.capabilities.Ssh"\r
-    const val MODEL_TYPE_CAPABILITY_TYPE_SFTP = "tosca.capabilities.Sftp"\r
-\r
-    const val EXPRESSION_GET_INPUT: String = "get_input"\r
-    const val EXPRESSION_GET_ATTRIBUTE: String = "get_attribute"\r
-    const val EXPRESSION_GET_ARTIFACT: String = "get_artifact"\r
-    const val EXPRESSION_GET_PROPERTY: String = "get_property"\r
-    const val EXPRESSION_GET_OPERATION_OUTPUT: String = "get_operation_output"\r
-    const val EXPRESSION_GET_NODE_OF_TYPE: String = "get_nodes_of_type"\r
-\r
-    const val PROPERTY_BLUEPRINT_PROCESS_ID: String = "blueprint-process-id"\r
-    const val PROPERTY_BLUEPRINT_BASE_PATH: String = "blueprint-basePath"\r
-    const val PROPERTY_BLUEPRINT_RUNTIME: String = "blueprint-runtime"\r
-    const val PROPERTY_BLUEPRINT_INPUTS_DATA: String = "blueprint-inputs-data"\r
-    const val PROPERTY_BLUEPRINT_CONTEXT: String = "blueprint-context"\r
-    const val PROPERTY_BLUEPRINT_NAME: String = "template_name"\r
-    const val PROPERTY_BLUEPRINT_VERSION: String = "template_version"\r
-\r
-    const val TOSCA_METADATA_DIR: String = "TOSCA-Metadata"\r
-    const val TOSCA_METADATA_ENTRY_DEFINITION_FILE: String = "TOSCA-Metadata/TOSCA.meta"\r
-    const val TOSCA_DEFINITIONS_DIR: String = "Definitions"\r
-    const val TOSCA_PLANS_DIR: String = "Plans"\r
-    const val TOSCA_SCRIPTS_DIR: String = "Scripts"\r
-    const val TOSCA_MAPPINGS_DIR: String = "Mappings"\r
-    const val TOSCA_TEMPLATES_DIR: String = "Templates"\r
-\r
-    const val METADATA_USER_GROUPS = "user-groups"\r
-    const val METADATA_TEMPLATE_NAME = "template_name"\r
-    const val METADATA_TEMPLATE_VERSION = "template_version"\r
-    const val METADATA_TEMPLATE_AUTHOR = "template_author"\r
-    const val METADATA_TEMPLATE_TAGS = "template_tags"\r
-    const val METADATA_WORKFLOW_NAME = "workflow_name"\r
-\r
-    const val PAYLOAD_DATA = "payload-data"\r
-    const val PROPERTY_CURRENT_STEP = "current-step"\r
-    const val PROPERTY_CURRENT_NODE_TEMPLATE = "current-node-template"\r
-    const val PROPERTY_CURRENT_INTERFACE = "current-interface"\r
-    const val PROPERTY_CURRENT_OPERATION = "current-operation"\r
-    const val PROPERTY_CURRENT_IMPLEMENTATION = "current-implementation"\r
-    const val PROPERTY_EXECUTION_REQUEST = "execution-request"\r
-\r
-    const val OPERATION_PROCESS = "process"\r
-    const val OPERATION_PREPARE = "prepare"\r
-\r
-    const val BLUEPRINT_RETRIEVE_TYPE_DB = "db"\r
-    const val BLUEPRINT_RETRIEVE_TYPE_FILE = "file"\r
-    const val BLUEPRINT_RETRIEVE_TYPE_REPO = "repo"\r
-\r
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.controllerblueprints.core
+
+/**
+ * BluePrintConstants
+ *
+ * @author Brinda Santh
+ */
+object BluePrintConstants {
+
+    const val RESPONSE_HEADER_TRANSACTION_ID: String = "X-ONAP-RequestID"
+    const val RESPONSE_HEADER_MINOR_VERSION: String = "X-MinorVersion"
+    const val RESPONSE_HEADER_PATCH_VERSION: String = "X-PatchVersion"
+    const val RESPONSE_HEADER_LATEST_VERSION: String = "X-LatestVersion"
+
+    const val STATUS_SUCCESS: String = "success"
+    const val STATUS_FAILURE: String = "failure"
+
+    const val TYPE_DEFAULT: String = "default"
+
+    const val DATA_TYPE_STRING: String = "string"
+    const val DATA_TYPE_INTEGER: String = "integer"
+    const val DATA_TYPE_FLOAT: String = "float"
+    const val DATA_TYPE_BOOLEAN: String = "boolean"
+    const val DATA_TYPE_TIMESTAMP: String = "timestamp"
+    const val DATA_TYPE_NULL: String = "null"
+    const val DATA_TYPE_LIST: String = "list"
+    const val DATA_TYPE_MAP: String = "map"
+
+    const val USER_SYSTEM: String = "System"
+
+    const val PATH_DIVIDER: String = "/"
+    const val PATH_SERVICE_TEMPLATE: String = "service_template"
+    const val PATH_TOPOLOGY_TEMPLATE: String = "topology_template"
+    const val PATH_METADATA: String = "metadata"
+    const val PATH_NODE_TYPES: String = "node_types"
+    const val PATH_POLICY_TYPES: String = "policy_types"
+    const val PATH_RELATIONSHIP_TYPES: String = "relationship_types"
+    const val PATH_ARTIFACT_TYPES: String = "artifact_types"
+    const val PATH_DATA_TYPES: String = "data_types"
+    const val PATH_INPUTS: String = "inputs"
+    const val PATH_NODE_WORKFLOWS: String = "workflows"
+    const val PATH_NODE_TEMPLATES: String = "node_templates"
+    const val PATH_CAPABILITIES: String = "capabilities"
+    const val PATH_REQUIREMENTS: String = "requirements"
+    const val PATH_INTERFACES: String = "interfaces"
+    const val PATH_OPERATIONS: String = "operations"
+    const val PATH_OUTPUTS: String = "outputs"
+    const val PATH_PROPERTIES: String = "properties"
+    const val PATH_ATTRIBUTES: String = "attributes"
+    const val PATH_ARTIFACTS: String = "artifacts"
+
+    const val MODEL_DIR_MODEL_TYPE: String = "definition-type"
+
+    const val MODEL_DEFINITION_TYPE_NODE_TYPE: String = "node_type"
+    const val MODEL_DEFINITION_TYPE_ARTIFACT_TYPE: String = "artifact_type"
+    const val MODEL_DEFINITION_TYPE_CAPABILITY_TYPE: String = "capability_type"
+    const val MODEL_DEFINITION_TYPE_RELATIONSHIP_TYPE: String = "relationship_type"
+    const val MODEL_DEFINITION_TYPE_DATA_TYPE: String = "data_type"
+
+    const val MODEL_TYPE_DATATYPES_ROOT: String = "tosca.datatypes.Root"
+    const val MODEL_TYPE_NODES_ROOT: String = "tosca.nodes.Root"
+    const val MODEL_TYPE_GROUPS_ROOT: String = "tosca.groups.Root"
+    const val MODEL_TYPE_RELATIONSHIPS_ROOT: String = "tosca.relationships.Root"
+    const val MODEL_TYPE_ARTIFACTS_ROOT: String = "tosca.artifacts.Root"
+    const val MODEL_TYPE_CAPABILITIES_ROOT: String = "tosca.capabilities.Root"
+    const val MODEL_TYPE_INTERFACES_ROOT: String = "tosca.interfaces.Root"
+
+    const val MODEL_TYPE_RELATIONSHIPS_DEPENDS_ON = "tosca.relationships.DependsOn"
+    const val MODEL_TYPE_RELATIONSHIPS_HOSTED_ON = "tosca.relationships.HostedOn"
+    const val MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO = "tosca.relationships.ConnectsTo"
+    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_COMPONENT = "tosca.nodes.Component"
+    const val MODEL_TYPE_NODE_VNF = "tosca.nodes.Vnf"
+    @Deprecated("Artifacts will be attached to Node Template")
+    const val MODEL_TYPE_NODE_ARTIFACT = "tosca.nodes.Artifact"
+    const val MODEL_TYPE_NODE_RESOURCE_SOURCE = "tosca.nodes.ResourceSource"
+
+    const val MODEL_TYPE_NODES_COMPONENT_JAVA: String = "tosca.nodes.component.Java"
+    const val MODEL_TYPE_NODES_COMPONENT_BUNDLE: String = "tosca.nodes.component.Bundle"
+    const val MODEL_TYPE_NODES_COMPONENT_SCRIPT: String = "tosca.nodes.component.Script"
+    const val MODEL_TYPE_NODES_COMPONENT_PYTHON: String = "tosca.nodes.component.Python"
+    const val MODEL_TYPE_NODES_COMPONENT_JYTHON: String = "tosca.nodes.component.Jython"
+    const val MODEL_TYPE_NODES_COMPONENT_JAVA_SCRIPT: String = "tosca.nodes.component.JavaScript"
+
+    const val MODEL_TYPE_ARTIFACT_TYPE_IMPLEMENTATION = "tosca.artifacts.Implementation"
+
+    const val MODEL_TYPE_DATA_TYPE_DYNAMIC = "tosca.datatypes.Dynamic"
+
+    const val MODEL_TYPE_CAPABILITY_TYPE_NODE = "tosca.capabilities.Node"
+    const val MODEL_TYPE_CAPABILITY_TYPE_COMPUTE = "tosca.capabilities.Compute"
+    const val MODEL_TYPE_CAPABILITY_TYPE_NETWORK = "tosca.capabilities.Network"
+    const val MODEL_TYPE_CAPABILITY_TYPE_STORAGE = "tosca.capabilities.Storage"
+    const val MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT = "tosca.capabilities.Endpoint"
+    const val MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT_PUBLIC = "tosca.capabilities.Endpoint.Public"
+    const val MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT_ADMIN = "tosca.capabilities.Endpoint.Admin"
+    const val MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT_DATABASE = "tosca.capabilities.Endpoint.Database"
+    const val MODEL_TYPE_CAPABILITY_TYPE_ATTACHMENT = "tosca.capabilities.Attachment"
+    const val MODEL_TYPE_CAPABILITY_TYPE_OPERATION_SYSTEM = "tosca.capabilities.OperatingSystem"
+    const val MODEL_TYPE_CAPABILITY_TYPE_BINDABLE = "tosca.capabilities.network.Bindable"
+    // Custom capabilities
+    const val MODEL_TYPE_CAPABILITY_TYPE_CONTENT = "tosca.capabilities.Content"
+    const val MODEL_TYPE_CAPABILITY_TYPE_MAPPING = "tosca.capabilities.Mapping"
+    const val MODEL_TYPE_CAPABILITY_TYPE_NETCONF = "tosca.capabilities.Netconf"
+    const val MODEL_TYPE_CAPABILITY_TYPE_SSH = "tosca.capabilities.Ssh"
+    const val MODEL_TYPE_CAPABILITY_TYPE_SFTP = "tosca.capabilities.Sftp"
+
+    const val EXPRESSION_GET_INPUT: String = "get_input"
+    const val EXPRESSION_GET_ATTRIBUTE: String = "get_attribute"
+    const val EXPRESSION_GET_ARTIFACT: String = "get_artifact"
+    const val EXPRESSION_GET_PROPERTY: String = "get_property"
+    const val EXPRESSION_GET_OPERATION_OUTPUT: String = "get_operation_output"
+    const val EXPRESSION_GET_NODE_OF_TYPE: String = "get_nodes_of_type"
+
+    const val PROPERTY_BLUEPRINT_PROCESS_ID: String = "blueprint-process-id"
+    const val PROPERTY_BLUEPRINT_BASE_PATH: String = "blueprint-basePath"
+    const val PROPERTY_BLUEPRINT_RUNTIME: String = "blueprint-runtime"
+    const val PROPERTY_BLUEPRINT_INPUTS_DATA: String = "blueprint-inputs-data"
+    const val PROPERTY_BLUEPRINT_CONTEXT: String = "blueprint-context"
+    const val PROPERTY_BLUEPRINT_NAME: String = "template_name"
+    const val PROPERTY_BLUEPRINT_VERSION: String = "template_version"
+
+    const val TOSCA_METADATA_DIR: String = "TOSCA-Metadata"
+    const val TOSCA_METADATA_ENTRY_DEFINITION_FILE: String = "TOSCA-Metadata/TOSCA.meta"
+    const val TOSCA_DEFINITIONS_DIR: String = "Definitions"
+    const val TOSCA_PLANS_DIR: String = "Plans"
+    const val TOSCA_SCRIPTS_DIR: String = "Scripts"
+    const val TOSCA_MAPPINGS_DIR: String = "Mappings"
+    const val TOSCA_TEMPLATES_DIR: String = "Templates"
+
+    const val METADATA_USER_GROUPS = "user-groups"
+    const val METADATA_TEMPLATE_NAME = "template_name"
+    const val METADATA_TEMPLATE_VERSION = "template_version"
+    const val METADATA_TEMPLATE_AUTHOR = "template_author"
+    const val METADATA_TEMPLATE_TAGS = "template_tags"
+    const val METADATA_WORKFLOW_NAME = "workflow_name"
+
+    const val PAYLOAD_DATA = "payload-data"
+    const val PROPERTY_CURRENT_STEP = "current-step"
+    const val PROPERTY_CURRENT_NODE_TEMPLATE = "current-node-template"
+    const val PROPERTY_CURRENT_INTERFACE = "current-interface"
+    const val PROPERTY_CURRENT_OPERATION = "current-operation"
+    const val PROPERTY_CURRENT_IMPLEMENTATION = "current-implementation"
+    const val PROPERTY_EXECUTION_REQUEST = "execution-request"
+
+    const val OPERATION_PROCESS = "process"
+    const val OPERATION_PREPARE = "prepare"
+
+    const val BLUEPRINT_RETRIEVE_TYPE_DB = "db"
+    const val BLUEPRINT_RETRIEVE_TYPE_FILE = "file"
+    const val BLUEPRINT_RETRIEVE_TYPE_REPO = "repo"
+
 }
\ No newline at end of file
index d031700..f9ef9ee 100644 (file)
                                                }\r
                                        }\r
                                },\r
-                               "db": {\r
+                               "primary-db": {\r
                                        "type": "object",\r
                                        "properties": {\r
                                                "query": {\r
                                                }\r
                                        }\r
                                },\r
-                               "db": {\r
+                               "primary-db": {\r
                                        "type": "object",\r
                                        "properties": {\r
                                                "names": {\r
index 1137c1d..13847bb 100644 (file)
                   },
                   "input-param": false,
                   "dictionary-name": "nf-role",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vnf-model-customization-uuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "protected-prefix-id",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "unprotected-prefix-id",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vf-nf-code",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vnf-model-customization-uuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vf-module-type",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vf-module-model-customization-uuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vfccustomizationuuid",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vf-module-model-customization-uuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vm-type",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vnfc-model-invariant-uuid",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vfccustomizationuuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vnfc-model-version",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vfccustomizationuuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "nfc-naming-code",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vfccustomizationuuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "unprotected_private_net_cidr",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "protected_private_net_cidr",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "onap_private_net_cidr",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vf-module-label",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vf-module-model-customization-uuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "private-prefix-id",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vf-module-type",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vf-module-model-customization-uuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vfccustomizationuuid",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vf-module-model-customization-uuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vm-type",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vnfc-model-invariant-uuid",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vfccustomizationuuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vnfc-model-version",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vfccustomizationuuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "nfc-naming-code",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vfccustomizationuuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "unprotected_private_net_cidr",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "onap_private_net_cidr",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vf-module-label",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vf-module-model-customization-uuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "private-prefix-id",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vf-module-type",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vf-module-model-customization-uuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vfccustomizationuuid",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vf-module-model-customization-uuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vm-type",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vnfc-model-invariant-uuid",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vfccustomizationuuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vnfc-model-version",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vfccustomizationuuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "nfc-naming-code",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vfccustomizationuuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "unprotected_private_net_cidr",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "protected_private_net_cidr",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "onap_private_net_cidr",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vf-module-label",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vf-module-model-customization-uuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "private-prefix-id",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "protected-prefix-id",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "vf-module-type",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vf-module-model-customization-uuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "nf-role",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     "vnf-model-customization-uuid"
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "unprotected_private_net_cidr",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
                   },
                   "input-param": false,
                   "dictionary-name": "protected_private_net_cidr",
-                  "dictionary-source": "db",
+                  "dictionary-source": "primary-db",
                   "dependencies": [
                     
                   ],
index 819c7e6..6da5ea2 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.VF_MODEL.nf_role as vf_model_role from sdnctl.VF_MODEL where sdnctl.VF_MODEL.customization_uuid=:vnfmodelcustomizationuuid",
index b827918..4e1ba2b 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select nfc_naming_code as nfc_naming_code from sdnctl.VFC_MODEL where customization_uuid=:vfccustomizationuuid",
index cee0601..42765ee 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = \"private\"",
@@ -1,5 +1,5 @@
 {
-  "name": "db-source",
+  "name": "primary-db-source",
   "property" :{
     "description": "name of the ",
     "type": "string"
@@ -7,8 +7,8 @@
   "updated-by": "brindasanth@onap.com",
   "tags": "bundle-id, brindasanth@onap.com",
   "sources": {
-    "db": {
-      "type": "source-db",
+    "primary-db": {
+      "type": "source-primary-db",
       "properties": {
         "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name",
         "input-key-mapping": {
index 5dea3e3..0685401 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = \"private\"",
index fb57274..f6120f3 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = \"protected\"",
index 261920f..bb477dc 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = \"protected\"",
@@ -5,10 +5,10 @@
     "type": "string"\r
   },\r
   "updated-by": "brindasanth@onap.com",\r
-  "tags": "db-source, brindasanth@onap.com",\r
+  "tags": "primary-db-source, brindasanth@onap.com",\r
   "sources": {\r
-    "db": {\r
-      "type": "source-db",\r
+    "primary-db": {\r
+      "type": "source-primary-db",\r
       "properties": {\r
         "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name",\r
         "input-key-mapping": {\r
index 3cb7320..c1fc541 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = \"unprotected\"",
index d2a339e..6048755 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = \"unprotected\"",
index ac5e21a..faa7ea4 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.VF_MODULE_MODEL.vf_module_label as vf_module_label from sdnctl.VF_MODULE_MODEL where sdnctl.VF_MODULE_MODEL.customization_uuid=:customizationid",
index 147425c..dbd51bb 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select vf_module_type as vf_module_type from sdnctl.VF_MODULE_MODEL where customization_uuid=:customizationid",
index f68cc37..70792f8 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.VF_MODEL.naming_policy as vf_naming_policy from sdnctl.VF_MODEL where sdnctl.VF_MODEL.customization_uuid=:vnf_model_customization_uuid",
index 1865d47..a21982c 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.VF_MODEL.nf_code as vf_nf_code from sdnctl.VF_MODEL where sdnctl.VF_MODEL.customization_uuid=:customizationid",
index 463f848..9f3e7cf 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.VF_MODULE_TO_VFC_MAPPING.vfc_customization_uuid as vnf_customid from sdnctl.VF_MODULE_TO_VFC_MAPPING where vm_count = 1 and sdnctl.VF_MODULE_TO_VFC_MAPPING.vf_module_customization_uuid=:vfmodulecustomizationuuid",
index 0204c64..9744316 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select VFC_MODEL.vm_type as vm_type from VFC_MODEL where customization_uuid=:vfccustomizationuuid",
index c894fb5..3d89d9d 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select VFC_MODEL.invariant_uuid as vfc_invariant_uuid from VFC_MODEL where customization_uuid=:vfccustomizationuuid",
index 45eb07f..d7fb501 100755 (executable)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select VFC_MODEL.version as vnfc_model_version from VFC_MODEL where customization_uuid=:vfccustomizationuuid",
index 0e108c5..df6b5df 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"\r
   },\r
   "sources" : {\r
-    "db" : {\r
-      "type" : "source-db",\r
+    "primary-db" : {\r
+      "type" : "source-primary-db",\r
       "properties" : {\r
         "type" : "SQL",\r
         "query" : "select sdnctl.VF_MODEL.nf_role as vf_model_role from sdnctl.VF_MODEL where sdnctl.VF_MODEL.customization_uuid=:vnfmodelcustomizationuuid",\r
index f0f2b7f..7c521a7 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"\r
   },\r
   "sources" : {\r
-    "db" : {\r
-      "type" : "source-db",\r
+    "primary-db" : {\r
+      "type" : "source-primary-db",\r
       "properties" : {\r
         "type" : "SQL",\r
         "query" : "select nfc_naming_code as nfc_naming_code from sdnctl.VFC_MODEL where customization_uuid=:vfccustomizationuuid",\r
index 07c5cbc..f2067a1 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"\r
   },\r
   "sources" : {\r
-    "db" : {\r
-      "type" : "source-db",\r
+    "primary-db" : {\r
+      "type" : "source-primary-db",\r
       "properties" : {\r
         "type" : "SQL",\r
         "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = private",\r
@@ -1,5 +1,5 @@
 {\r
-  "name": "db-source",\r
+  "name": "primary-db-source",\r
   "property" :{\r
     "description": "name of the ",\r
     "type": "string"\r
@@ -7,8 +7,8 @@
   "updated-by": "brindasanth@onap.com",\r
   "tags": "bundle-id, brindasanth@onap.com",\r
   "sources": {\r
-    "db": {\r
-      "type": "source-db",\r
+    "primary-db": {\r
+      "type": "source-primary-db",\r
       "properties": {\r
         "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name",\r
         "input-key-mapping": {\r
index a95bae3..309647d 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"\r
   },\r
   "sources" : {\r
-    "db" : {\r
-      "type" : "source-db",\r
+    "primary-db" : {\r
+      "type" : "source-primary-db",\r
       "properties" : {\r
         "type" : "SQL",\r
         "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = private",\r
index 56b0d6d..816405b 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"\r
   },\r
   "sources" : {\r
-    "db" : {\r
-      "type" : "source-db",\r
+    "primary-db" : {\r
+      "type" : "source-primary-db",\r
       "properties" : {\r
         "type" : "SQL",\r
         "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = protected",\r
index db0a43d..bf46fb3 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"\r
   },\r
   "sources" : {\r
-    "db" : {\r
-      "type" : "source-db",\r
+    "primary-db" : {\r
+      "type" : "source-primary-db",\r
       "properties" : {\r
         "type" : "SQL",\r
         "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = protected",\r
index a0d966a..8a09b14 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"\r
   },\r
   "sources" : {\r
-    "db" : {\r
-      "type" : "source-db",\r
+    "primary-db" : {\r
+      "type" : "source-primary-db",\r
       "properties" : {\r
         "type" : "SQL",\r
         "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = unprotected",\r
index 8f9385d..241147c 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"
   },
   "sources" : {
-    "db" : {
-      "type" : "source-db",
+    "primary-db" : {
+      "type" : "source-primary-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = unprotected",
index a954372..01355c2 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"\r
   },\r
   "sources" : {\r
-    "db" : {\r
-      "type" : "source-db",\r
+    "primary-db" : {\r
+      "type" : "source-primary-db",\r
       "properties" : {\r
         "type" : "SQL",\r
         "query" : "select sdnctl.VF_MODULE_MODEL.vf_module_label as vf_module_label from sdnctl.VF_MODULE_MODEL where sdnctl.VF_MODULE_MODEL.customization_uuid=:customizationid",\r
index 805d834..ead69d4 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"\r
   },\r
   "sources" : {\r
-    "db" : {\r
-      "type" : "source-db",\r
+    "primary-db" : {\r
+      "type" : "source-primary-db",\r
       "properties" : {\r
         "type" : "SQL",\r
         "query" : "select vf_module_type as vf_module_type from sdnctl.VF_MODULE_MODEL where customization_uuid=:customizationid",\r
index ceed318..cde861f 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"\r
   },\r
   "sources" : {\r
-    "db" : {\r
-      "type" : "source-db",\r
+    "primary-db" : {\r
+      "type" : "source-primary-db",\r
       "properties" : {\r
         "type" : "SQL",\r
         "query" : "select sdnctl.VF_MODEL.naming_policy as vf_naming_policy from sdnctl.VF_MODEL where sdnctl.VF_MODEL.customization_uuid=:vnf_model_customization_uuid",\r
index 0d25d0e..adbd22a 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"\r
   },\r
   "sources" : {\r
-    "db" : {\r
-      "type" : "source-db",\r
+    "primary-db" : {\r
+      "type" : "source-primary-db",\r
       "properties" : {\r
         "type" : "SQL",\r
         "query" : "select sdnctl.VF_MODEL.nf_code as vf_nf_code from sdnctl.VF_MODEL where sdnctl.VF_MODEL.customization_uuid=:customizationid",\r
index a34a9a7..b348579 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"\r
   },\r
   "sources" : {\r
-    "db" : {\r
-      "type" : "source-db",\r
+    "primary-db" : {\r
+      "type" : "source-primary-db",\r
       "properties" : {\r
         "type" : "SQL",\r
         "query" : "select sdnctl.VF_MODULE_TO_VFC_MAPPING.vfc_customization_uuid as vnf_customid from sdnctl.VF_MODULE_TO_VFC_MAPPING where vm_count = 1 and sdnctl.VF_MODULE_TO_VFC_MAPPING.vf_module_customization_uuid=:vfmodulecustomizationuuid",\r
index 7bb5ef1..e559f9b 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"\r
   },\r
   "sources" : {\r
-    "db" : {\r
-      "type" : "source-db",\r
+    "primary-db" : {\r
+      "type" : "source-primary-db",\r
       "properties" : {\r
         "type" : "SQL",\r
         "query" : "select vfc_model.vm_type as vm_type from VFC_MODEL where customization_uuid=:vfccustomizationuuid",\r
index b2ccd45..9eb94cf 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"\r
   },\r
   "sources" : {\r
-    "db" : {\r
-      "type" : "source-db",\r
+    "primary-db" : {\r
+      "type" : "source-primary-db",\r
       "properties" : {\r
         "type" : "SQL",\r
         "query" : "select vfc_model.invariant_uuid as vfc_invariant_uuid from VFC_MODEL where customization_uuid=:vfccustomizationuuid",\r
index fb59eea..e4e6622 100644 (file)
@@ -7,8 +7,8 @@
     "type" : "string"\r
   },\r
   "sources" : {\r
-    "db" : {\r
-      "type" : "source-db",\r
+    "primary-db" : {\r
+      "type" : "source-primary-db",\r
       "properties" : {\r
         "type" : "SQL",\r
         "query" : "select vfc_model.version as vnfc_model_version from VFC_MODEL where customization_uuid=:vfccustomizationuuid",\r
index a39139e..e4219c1 100644 (file)
@@ -23,7 +23,7 @@ package org.onap.ccsdk.apps.controllerblueprints.resource.dict
 object ResourceDictionaryConstants {
     const val SOURCE_INPUT = "input"
     const val SOURCE_DEFAULT = "default"
-    const val SOURCE_DB = "db"
+    const val SOURCE_DB = "primary-db"
 
     const val MODEL_DIR_RESOURCE_DEFINITION: String = "resource_dictionary"
 
diff --git a/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceAssignmentUtils.kt b/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceAssignmentUtils.kt
new file mode 100644 (file)
index 0000000..a234a89
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.controllerblueprints.resource.dict.utils
+
+import java.util.Date
+import com.att.eelf.configuration.EELFLogger
+import com.att.eelf.configuration.EELFManager
+import com.fasterxml.jackson.databind.JsonNode
+import com.fasterxml.jackson.databind.ObjectMapper
+import com.fasterxml.jackson.databind.node.NullNode
+import com.fasterxml.jackson.databind.node.ObjectNode
+import org.onap.ccsdk.apps.controllerblueprints.core.*
+import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment
+
+class ResourceAssignmentUtils {
+    companion object {
+
+        private val logger: EELFLogger = EELFManager.getInstance().getLogger(ResourceAssignmentUtils::class.toString())
+
+        @Synchronized
+        @Throws(BluePrintProcessorException::class)
+        fun setResourceDataValue(resourceAssignment: ResourceAssignment, value: Any?) {
+
+            val resourceProp = checkNotNull(resourceAssignment.property) { "Failed in setting resource value for resource mapping $resourceAssignment" }
+            checkNotEmptyNThrow(resourceAssignment.name, "Failed in setting resource value for resource mapping $resourceAssignment")
+
+            if (checkNotEmpty(resourceAssignment.dictionaryName)) {
+                resourceAssignment.dictionaryName = resourceAssignment.name
+                logger.warn("Missing dictionary key, setting with template key (${resourceAssignment.name}) as dictionary key (${resourceAssignment.dictionaryName})")
+            }
+
+            try {
+                if (checkNotEmpty(resourceProp.type)) {
+                    val convertedValue = convertResourceValue(resourceProp.type, value)
+                    logger.info("Setting Resource Value ($convertedValue) for Resource Name (${resourceAssignment.dictionaryName}) of type (${resourceProp.type})")
+                    resourceProp.value = convertedValue
+                    resourceAssignment.updatedDate = Date()
+                    resourceAssignment.updatedBy = BluePrintConstants.USER_SYSTEM
+                    resourceAssignment.status = BluePrintConstants.STATUS_SUCCESS
+                }
+            } catch (e: Exception) {
+                throw BluePrintProcessorException("Failed in setting value for template key (%s) and " +
+                        "dictionary key (${resourceAssignment.name}) of type (${resourceProp.type}) with error message (${e.message})", e)
+            }
+        }
+
+        private fun convertResourceValue(type: String, value: Any?): JsonNode? {
+            var convertedValue: JsonNode?
+
+            if (value == null || value is NullNode) {
+                logger.info("Returning {} value from convertResourceValue", value)
+                return null
+            } else if (BluePrintTypes.validPrimitiveTypes().contains(type) && value is String) {
+                convertedValue = JacksonUtils.convertPrimitiveResourceValue(type, value)
+            } else {
+                // Case where Resource is non-primitive type
+                if (value is String) {
+                    convertedValue = JacksonUtils.jsonNode(value)
+                } else {
+                    convertedValue = JacksonUtils.getJsonNode(value)
+                }
+            }
+            return convertedValue
+        }
+
+        @Synchronized
+        fun setFailedResourceDataValue(resourceAssignment: ResourceAssignment, message: String?) {
+            if (checkNotEmpty(resourceAssignment.name)) {
+                resourceAssignment.updatedDate = Date()
+                resourceAssignment.updatedBy = BluePrintConstants.USER_SYSTEM
+                resourceAssignment.status = BluePrintConstants.STATUS_FAILURE
+                resourceAssignment.message = message
+            }
+        }
+
+        @Synchronized
+        @Throws(BluePrintProcessorException::class)
+        fun assertTemplateKeyValueNotNull(resourceAssignment: ResourceAssignment) {
+            val resourceProp = checkNotNull(resourceAssignment.property) { "Failed to populate mandatory resource resource mapping $resourceAssignment" }
+            if (resourceProp.required != null && resourceProp.required!! && (resourceProp.value == null || resourceProp.value !is NullNode)) {
+                logger.error("failed to populate mandatory resource mapping ($resourceAssignment)")
+                throw BluePrintProcessorException("failed to populate mandatory resource mapping ($resourceAssignment)")
+            }
+        }
+
+        @Synchronized
+        @Throws(BluePrintProcessorException::class)
+        fun generateResourceDataForAssignments(assignments: List<ResourceAssignment>): String {
+            var result = "{}"
+            try {
+                val mapper = ObjectMapper()
+                val root = mapper.readTree(result)
+
+                assignments.forEach {
+                    if (checkNotEmpty(it.name) && it.property != null) {
+
+                        val type = it.property?.type
+                        val value = it.property?.value
+                        logger.info("Generating Resource name ({}), type ({}), value ({})", it.name, type,
+                                value)
+                        if (value == null) {
+                            (root as ObjectNode).set(it.name, null)
+                        } else if (value is JsonNode) {
+                            (root as ObjectNode).put(it.name, value as JsonNode)
+                        } else if (BluePrintConstants.DATA_TYPE_STRING.equals(type, ignoreCase = true)) {
+                            (root as ObjectNode).put(it.name, value as String)
+                        } else if (BluePrintConstants.DATA_TYPE_BOOLEAN.equals(type, ignoreCase = true)) {
+                            (root as ObjectNode).put(it.name, value as Boolean)
+                        } else if (BluePrintConstants.DATA_TYPE_INTEGER.equals(type, ignoreCase = true)) {
+                            (root as ObjectNode).put(it.name, value as Int)
+                        } else if (BluePrintConstants.DATA_TYPE_FLOAT.equals(type, ignoreCase = true)) {
+                            (root as ObjectNode).put(it.name, value as Float)
+                        } else if (BluePrintConstants.DATA_TYPE_TIMESTAMP.equals(type, ignoreCase = true)) {
+                            (root as ObjectNode).put(it.name, value as String)
+                        } else {
+                            val jsonNode = JacksonUtils.getJsonNode(value)
+                            if (jsonNode != null) {
+                                (root as ObjectNode).put(it.name, jsonNode)
+                            } else {
+                                (root as ObjectNode).set(it.name, null)
+                            }
+                        }
+                    }
+                }
+                result = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(root)
+                logger.info("Generated Resource Param Data ({})", result)
+            } catch (e: Exception) {
+                throw BluePrintProcessorException("kapil is failing with $e.message", e)
+            }
+
+            return result
+        }
+
+        fun <T> transformResourceSource(properties: MutableMap<String, JsonNode>, classType: Class<T>): T {
+            val content = JacksonUtils.getJson(properties)
+            return JacksonUtils.readValue(content, classType)
+                    ?: throw BluePrintProcessorException("failed to transform content($content) to type($classType)")
+        }
+
+    }
+}
\ No newline at end of file
index cb39200..1ed306e 100644 (file)
@@ -46,9 +46,9 @@ public class ResourceDefinitionTest {
     @Test\r
     public void testDictionaryDefinitionDBSource(){\r
 \r
-        String fileName = basePath + "/db-source.json";\r
+        String fileName = basePath + "/primary-db-source.json";\r
         ResourceDefinition resourceDefinition = JacksonUtils.Companion.readValueFromFile(fileName, ResourceDefinition.class);\r
-        Assert.assertNotNull("Failed to populate dictionaryDefinition for db type", resourceDefinition);\r
+        Assert.assertNotNull("Failed to populate dictionaryDefinition for primary-db type", resourceDefinition);\r
     }\r
 \r
     @Test\r
index b67aa79..3f5aef4 100644 (file)
@@ -25,13 +25,13 @@ public class ResourceSourceMappingFactoryTest {
     @Test\r
     public void testRegisterResourceMapping() {\r
 \r
-        ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("db", "source-db");\r
+        ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("primary-db", "source-primary-db");\r
         ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("input", "source-input");\r
         ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("default", "source-default");\r
         ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("mdsal", "source-rest");\r
 \r
-        String nodeTypeName = ResourceSourceMappingFactory.INSTANCE.getRegisterSourceMapping("db");\r
-        Assert.notNull(nodeTypeName, "Failed to get db mapping");\r
+        String nodeTypeName = ResourceSourceMappingFactory.INSTANCE.getRegisterSourceMapping("primary-db");\r
+        Assert.notNull(nodeTypeName, "Failed to get primary-db mapping");\r
 \r
         ResourceSourceMapping resourceSourceMapping = ResourceSourceMappingFactory.INSTANCE.getRegisterSourceMapping();\r
         Assert.notNull(resourceSourceMapping, "Failed to get resource source mapping");\r
index f5c3567..7f040b2 100644 (file)
@@ -30,10 +30,10 @@ public class ResourceDefinitionValidationServiceTest {
     @Test
     public void testValidateSource() throws Exception {
 
-        String inputFileName = dictionaryPath + "/db-source.json";
+        String inputFileName = dictionaryPath + "/input-source.json";
         testValidate(inputFileName);
 
-        String dbFileName = dictionaryPath + "/db-source.json";
+        String dbFileName = dictionaryPath + "/primary-db-source.json";
         testValidate(dbFileName);
 
         String defaultFileName = dictionaryPath + "/default-source.json";
@@ -22,7 +22,7 @@ object ResourceDictionaryTestUtils {
 \r
     @JvmStatic\r
     fun setUpResourceSourceMapping() {\r
-        ResourceSourceMappingFactory.registerSourceMapping("db", "source-db")\r
+        ResourceSourceMappingFactory.registerSourceMapping("primary-db", "source-primary-db")\r
         ResourceSourceMappingFactory.registerSourceMapping("input", "source-input")\r
         ResourceSourceMappingFactory.registerSourceMapping("default", "source-default")\r
         ResourceSourceMappingFactory.registerSourceMapping("mdsal", "source-rest")\r
index d837dc5..7e6472f 100644 (file)
       "type": "string"\r
     },\r
     "dictionary-name": "loopback-ip",\r
-    "dictionary-source": "db",\r
+    "dictionary-source": "primary-db",\r
     "dependencies": [\r
       "bundle-mac",\r
       "managed-ip1"\r
index 330324c..28ab71f 100644 (file)
       "type": "string"\r
     },\r
     "dictionary-name": "loopback-ip",\r
-    "dictionary-source": "db",\r
+    "dictionary-source": "primary-db",\r
     "dependencies": [\r
       "bundle-mac"\r
     ]\r
index 3215d06..5d0e898 100644 (file)
       "type": "string"\r
     },\r
     "dictionary-name": "loopback-ip",\r
-    "dictionary-source": "db",\r
+    "dictionary-source": "primary-db",\r
     "dependencies": [\r
       "bundle-mac"\r
     ]\r