From 252e13314785fb91003adcb9902a5f8dc8d86683 Mon Sep 17 00:00:00 2001 From: Steve Alphonse Siani Date: Mon, 21 Jan 2019 11:55:48 -0500 Subject: ControllerBlueprint blueprintsProcessor container Change-Id: I77df77757c276fca705091c1566c386f842269c4 Issue-ID: CCSDK-949 Signed-off-by: Steve Alphonse Siani --- .../src/main/resources/application-dev.properties | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100755 ms/controllerblueprints/application/src/main/resources/application-dev.properties (limited to 'ms/controllerblueprints/application/src/main/resources/application-dev.properties') diff --git a/ms/controllerblueprints/application/src/main/resources/application-dev.properties b/ms/controllerblueprints/application/src/main/resources/application-dev.properties new file mode 100755 index 000000000..30b71fb41 --- /dev/null +++ b/ms/controllerblueprints/application/src/main/resources/application-dev.properties @@ -0,0 +1,70 @@ +# +# 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. +# +appName=ControllerBluePrints +ms_name=org.onap.ccsdk.apps.controllerblueprints +appVersion=1.0.0 + +# Basic Authentication +basic-auth.user-name=ccsdkapps +basic-auth.hashed-pwd={bcrypt}$2a$10$MJxhNiOAffxbyrV9.rrOUewP9Q/ASg5Nit2cmP.yBaXGsVXo8BW3y + +#logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr($ threadId: {PID:- }){magenta} %clr(---){faint} %clr([ hostname: %X{hostname} serviceName: %X{serviceName} version: %X{version} transactionId: %X{transactionId} requestTimeStamp: %X{requestTimestamp} responseTimeStamp: %X{responseTimestamp} duration: %X{duration}]){yellow} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex + +logging.level.org.springframework.web=INFO +logging.level.org.hibernate.SQL=warn +logging.level.org.hibernate.type.descriptor.sql=debug + +#To Remove Null in JSON API Response +spring.jackson.default-property-inclusion=non_null + +#Swagger Configuration +swagger.contact.name=Brinda Santh Muthuramalingam +swagger.contact.url=www.onap.com +swagger.contact.email=brindasanth@onap.com + +spring.jpa.properties.hibernate.show_sql=true +spring.jpa.properties.hibernate.use_sql_comments=true +spring.jpa.properties.hibernate.format_sql=true + +# spring.datasource.url, spring.datasource.username,spring.datasource.password may be overridden by ENV variables +spring.datasource.url=jdbc:mysql://localhost:3306/sdnctl +spring.datasource.username=sdnctl +spring.datasource.password=sdnctl +spring.datasource.driver-class-name=org.mariadb.jdbc.Driver +spring.jpa.show-sql=true +spring.jpa.hibernate.ddl-auto=none +spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect +# Load Resource Source Mappings +resourceSourceMappings=db=source-db,input=source-input,default=source-default,mdsal=source-rest,capability=source-capability +# Controller Blueprints Core Configuration +controllerblueprints.blueprintDeployPath=/etc/blueprints/deploy +controllerblueprints.blueprintArchivePath=/etc/blueprints/archive +controllerblueprints.blueprintEnrichmentPath=/etc/blueprints/enrichment +# Controller Blueprint Load Configurations +controllerblueprints.loadInitialData=true +controllerblueprints.loadBluePrint=false +controllerblueprints.loadBluePrintPaths=./../../../components/model-catalog/blueprint-model/starter-blueprint +controllerblueprints.loadModelType=true +controllerblueprints.loadModeTypePaths=./../../../components/model-catalog/definition-type/starter-type +controllerblueprints.loadResourceDictionary=true +controllerblueprints.loadResourceDictionaryPaths=./../../../components/model-catalog/resource-dictionary/starter-dictionary + +# CBA file extension +controllerblueprints.loadCbaExtension=zip + +# Web server config +server.port=8080 \ No newline at end of file -- cgit 1.2.3-korg From 6db6cd0c934e992acd2fbcc788de9649f760e12f Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh" Date: Fri, 8 Feb 2019 12:15:11 -0500 Subject: Refactor test blueprint catalog Change-Id: I948067b25787c7a79f769ac4055c34ffdd2f172d Issue-ID: CCSDK-1047 Signed-off-by: Muthuramalingam, Brinda Santh --- .../opt/app/onap/config/application-dev.properties | 2 +- .../opt/app/onap/config/application.properties | 2 +- .../src/main/resources/application-dev.properties | 2 +- .../src/main/resources/application.properties | 2 +- .../src/test/resources/application.properties | 4 +- .../core/service/BluePrintContextTest.kt | 2 +- .../core/service/BluePrintRuntimeServiceTest.kt | 2 +- .../BluePrintValidatorDefaultServiceTest.kt | 2 +- .../core/utils/BluePrintFileUtilsTest.kt | 2 +- .../core/utils/BluePrintMetadataUtilsTest.kt | 2 +- .../BluePrintValidatorServiceImplTest.kt | 2 +- .../blueprints/vrr-test/Definitions/vrr-test.json | 759 --------------------- .../blueprints/vrr-test/TOSCA-Metadata/TOSCA.meta | 5 - .../vrr-test/Templates/base-config-template.vtl | 40 -- .../vrr-test/Templates/licence-template.vtl | 4 - .../service/load/blueprints/vrr-test/__init__.py | 0 .../enhancer/BluePrintEnhancerServiceImplTest.kt | 2 +- .../src/test/resources/application.properties | 4 +- 18 files changed, 15 insertions(+), 823 deletions(-) delete mode 100644 ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Definitions/vrr-test.json delete mode 100644 ms/controllerblueprints/modules/service/load/blueprints/vrr-test/TOSCA-Metadata/TOSCA.meta delete mode 100644 ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Templates/base-config-template.vtl delete mode 100644 ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Templates/licence-template.vtl delete mode 100644 ms/controllerblueprints/modules/service/load/blueprints/vrr-test/__init__.py (limited to 'ms/controllerblueprints/application/src/main/resources/application-dev.properties') diff --git a/ms/controllerblueprints/application/opt/app/onap/config/application-dev.properties b/ms/controllerblueprints/application/opt/app/onap/config/application-dev.properties index 81b3061aa..1c9029d5b 100755 --- a/ms/controllerblueprints/application/opt/app/onap/config/application-dev.properties +++ b/ms/controllerblueprints/application/opt/app/onap/config/application-dev.properties @@ -57,7 +57,7 @@ controllerblueprints.blueprintEnrichmentPath=/etc/blueprints/enrichment # Controller Blueprint Load Configurations controllerblueprints.loadInitialData=true controllerblueprints.loadBluePrint=false -controllerblueprints.loadBluePrintPaths=./../../../components/model-catalog/blueprint-model/starter-blueprint +controllerblueprints.loadBluePrintPaths=./../../../components/model-catalog/blueprint-model/test-blueprint controllerblueprints.loadModelType=true controllerblueprints.loadModeTypePaths=./../../../components/model-catalog/definition-type/starter-type controllerblueprints.loadResourceDictionary=true diff --git a/ms/controllerblueprints/application/opt/app/onap/config/application.properties b/ms/controllerblueprints/application/opt/app/onap/config/application.properties index 5b651e661..049d846e6 100755 --- a/ms/controllerblueprints/application/opt/app/onap/config/application.properties +++ b/ms/controllerblueprints/application/opt/app/onap/config/application.properties @@ -62,7 +62,7 @@ controllerblueprints.blueprintEnrichmentPath=/etc/blueprints/enrichment # blueprints.load.initial-data may be overridden by ENV variables controllerblueprints.loadInitialData=true controllerblueprints.loadBluePrint=false -controllerblueprints.loadBluePrintPaths=/model-catalog/blueprint-model/starter-blueprint +controllerblueprints.loadBluePrintPaths=/model-catalog/blueprint-model/test-blueprint controllerblueprints.loadModelType=true controllerblueprints.loadModeTypePaths=/model-catalog/definition-type/starter-type controllerblueprints.loadResourceDictionary=true diff --git a/ms/controllerblueprints/application/src/main/resources/application-dev.properties b/ms/controllerblueprints/application/src/main/resources/application-dev.properties index 30b71fb41..9a5e75d35 100755 --- a/ms/controllerblueprints/application/src/main/resources/application-dev.properties +++ b/ms/controllerblueprints/application/src/main/resources/application-dev.properties @@ -57,7 +57,7 @@ controllerblueprints.blueprintEnrichmentPath=/etc/blueprints/enrichment # Controller Blueprint Load Configurations controllerblueprints.loadInitialData=true controllerblueprints.loadBluePrint=false -controllerblueprints.loadBluePrintPaths=./../../../components/model-catalog/blueprint-model/starter-blueprint +controllerblueprints.loadBluePrintPaths=./../../../components/model-catalog/blueprint-model/test-blueprint controllerblueprints.loadModelType=true controllerblueprints.loadModeTypePaths=./../../../components/model-catalog/definition-type/starter-type controllerblueprints.loadResourceDictionary=true diff --git a/ms/controllerblueprints/application/src/main/resources/application.properties b/ms/controllerblueprints/application/src/main/resources/application.properties index ec61be48b..0c789364b 100755 --- a/ms/controllerblueprints/application/src/main/resources/application.properties +++ b/ms/controllerblueprints/application/src/main/resources/application.properties @@ -61,7 +61,7 @@ controllerblueprints.blueprintEnrichmentPath=/etc/blueprints/enrichment # blueprints.load.initial-data may be overridden by ENV variables controllerblueprints.loadInitialData=true controllerblueprints.loadBluePrint=false -controllerblueprints.loadBluePrintPaths=/model-catalog/blueprint-model/starter-blueprint +controllerblueprints.loadBluePrintPaths=/model-catalog/blueprint-model/test-blueprint controllerblueprints.loadModelType=true controllerblueprints.loadModeTypePaths=/model-catalog/definition-type/starter-type controllerblueprints.loadResourceDictionary=true diff --git a/ms/controllerblueprints/application/src/test/resources/application.properties b/ms/controllerblueprints/application/src/test/resources/application.properties index 9aebd7936..e0369aea4 100755 --- a/ms/controllerblueprints/application/src/test/resources/application.properties +++ b/ms/controllerblueprints/application/src/test/resources/application.properties @@ -42,7 +42,7 @@ controllerblueprints.blueprintEnrichmentPath=./target/blueprints/enrichment # Controller Blueprint Load Configurations controllerblueprints.loadInitialData=false controllerblueprints.loadBluePrint=false -controllerblueprints.loadBluePrintPaths=./../../../../components/model-catalog/blueprint-model/starter-blueprint +controllerblueprints.loadBluePrintPaths=./../../../../components/model-catalog/blueprint-model/test-blueprint controllerblueprints.loadModelType=false controllerblueprints.loadModeTypePaths=./../../../../components/model-catalog/definition-type/starter-type controllerblueprints.loadResourceDictionary=false @@ -52,7 +52,7 @@ controllerblueprints.loadResourceDictionaryPaths=./../../../../components/model- controllerblueprints.loadCbaExtension=zip # CBA examples for tests cases -controllerblueprints.loadBlueprintsExamplesPath=./../../../../components/model-catalog/blueprint-model/test-blueprints +controllerblueprints.loadBlueprintsExamplesPath=./../../../../components/model-catalog/blueprint-model/test-blueprint # Web server config server.port=8080 \ No newline at end of file diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintContextTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintContextTest.kt index 0c4d94f3c..d06ce234d 100644 --- a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintContextTest.kt +++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintContextTest.kt @@ -34,7 +34,7 @@ class BluePrintContextTest { private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString()) - val blueprintBasePath: String = ("./../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration") + val blueprintBasePath: String = ("./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration") @Test fun testBluePrintContextCreation() { diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt index 7a178758a..03e233ff2 100644 --- a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt +++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt @@ -132,7 +132,7 @@ class BluePrintRuntimeServiceTest { } private fun getBluePrintRuntimeService(): BluePrintRuntimeService> { - val blueprintBasePath: String = ("./../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration") + val blueprintBasePath: String = ("./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration") val blueprintRuntime = BluePrintMetadataUtils.getBluePrintRuntime("1234", blueprintBasePath) val checkBasePath = blueprintRuntime.get(BluePrintConstants.PROPERTY_BLUEPRINT_BASE_PATH) diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintValidatorDefaultServiceTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintValidatorDefaultServiceTest.kt index 861f7d095..be360d900 100644 --- a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintValidatorDefaultServiceTest.kt +++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintValidatorDefaultServiceTest.kt @@ -39,7 +39,7 @@ class BluePrintValidatorDefaultServiceTest { @Test fun testValidateBluePrint() { - val blueprintBasePath: String = ("./../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration") + val blueprintBasePath: String = ("./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration") val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext(blueprintBasePath) val properties: MutableMap = hashMapOf() diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/BluePrintFileUtilsTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/BluePrintFileUtilsTest.kt index 528f2c6f2..129317312 100644 --- a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/BluePrintFileUtilsTest.kt +++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/BluePrintFileUtilsTest.kt @@ -35,7 +35,7 @@ class BluePrintFileUtilsTest { @Test fun testBlueprintCopy() = runBlocking { - val sourcePath: String = "./../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration" + val sourcePath: String = "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" val targetPath: String = Paths.get("target").toUri().toURL().path.plus("/bp-copy-test") diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/BluePrintMetadataUtilsTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/BluePrintMetadataUtilsTest.kt index 80daad5d8..599bb3bef 100644 --- a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/BluePrintMetadataUtilsTest.kt +++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/BluePrintMetadataUtilsTest.kt @@ -27,7 +27,7 @@ class BluePrintMetadataUtilsTest { @Test fun testToscaMetaData(){ - val basePath : String = "./../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration" + val basePath : String = "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" val toscaMetaData : ToscaMetaData = BluePrintMetadataUtils.toscaMetaData(basePath) assertNotNull(toscaMetaData, "Missing Tosca Definition Object") diff --git a/ms/controllerblueprints/modules/blueprint-validation/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/validation/BluePrintValidatorServiceImplTest.kt b/ms/controllerblueprints/modules/blueprint-validation/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/validation/BluePrintValidatorServiceImplTest.kt index e48035bca..f5d157dd2 100644 --- a/ms/controllerblueprints/modules/blueprint-validation/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/validation/BluePrintValidatorServiceImplTest.kt +++ b/ms/controllerblueprints/modules/blueprint-validation/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/validation/BluePrintValidatorServiceImplTest.kt @@ -32,7 +32,7 @@ import kotlin.test.assertTrue class BluePrintValidatorServiceImplTest { - private val blueprintBasePath: String = ("./../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration") + private val blueprintBasePath: String = ("./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration") private val bluePrintRuntime = BluePrintMetadataUtils.getBluePrintRuntime("1234", blueprintBasePath) private val mockBluePrintTypeValidatorService = MockBluePrintTypeValidatorService() private val defaultBluePrintValidatorService = BluePrintValidatorServiceImpl(mockBluePrintTypeValidatorService) diff --git a/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Definitions/vrr-test.json b/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Definitions/vrr-test.json deleted file mode 100644 index 41f6e92f0..000000000 --- a/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Definitions/vrr-test.json +++ /dev/null @@ -1,759 +0,0 @@ -{ - "metadata": { - "template_author": "Brinda Santh ( bs2796@onap.com )", - "template_name": "vrr-test", - "template_version": "1.0.0", - "template_tags": "brinda, VRR", - "release": "201802", - "service-type": "AVPN", - "vnf-type": "VRR" - }, - "topology_template": { - "inputs": { - "request-id": { - "required": true, - "type": "string" - }, - "service-instance-id": { - "required": true, - "type": "string" - }, - "action-name": { - "required": true, - "type": "string" - }, - "scope-type": { - "required": true, - "type": "string" - }, - "hostname": { - "required": true, - "type": "string" - }, - "resource-assignment-request": { - "description": "This is Dynamic Data type for the receipe resource-assignment-action.", - "required": false, - "type": "dt-resource-assignment-request" - } - }, - "node_templates": { - "base-config-template": { - "type": "artifact-config-template", - "properties": { - "action-names": [ - "resource-assignment-action" - ] - }, - "capabilities": { - "content": { - "properties": { - "content": "db://base-config-template" - } - }, - "mapping": { - "properties": { - "mapping": [ - { - "name": "vnf-id", - "input-param": true, - "property": { - "type": "string", - "required": true - }, - "dictionary-name": "vnf-id", - "dictionary-source": "input" - }, - { - "name": "group-name", - "input-param": true, - "property": { - "type": "string", - "required": true - }, - "dictionary-name": "group-name", - "dictionary-source": "input" - } - ] - } - } - } - }, - "activate-action": { - "type": "dg-activate-netconf", - "interfaces": { - "CONFIG": { - "operations": { - "ActivateNetconf": {} - } - } - }, - "capabilities": { - "dg-node": {} - }, - "requirements": { - "component-dependency": { - "capability": "component-node", - "node": "transaction-netconf-baseconfig", - "relationship": "tosca.relationships.DependsOn" - } - } - }, - "resource-assignment-action": { - "type": "dg-resource-assignment", - "interfaces": { - "CONFIG": { - "operations": { - "ResourceAssignment": {} - } - } - }, - "capabilities": { - "dg-node": {} - }, - "requirements": { - "component-dependency": { - "capability": "component-node", - "node": "resource-assignment", - "relationship": "tosca.relationships.DependsOn" - } - } - }, - "licence-template": { - "type": "artifact-config-template", - "properties": { - "action-names": [ - "resource-assignment-action" - ] - }, - "capabilities": { - "content": { - "properties": { - "content": "db://licence-template" - } - }, - "mapping": { - "properties": { - "mapping": [ - { - "name": "licence-key", - "input-param": true, - "property": { - "type": "string", - "required": true - }, - "dictionary-name": "licence-key", - "dictionary-source": "input" - } - ] - } - } - } - }, - "runningconfig-template": { - "type": "artifact-config-template", - "properties": { - "action-names": [ - "resource-assignment-action" - ] - }, - "capabilities": { - "content": { - "properties": { - "content": "db://runningconfig-template" - } - }, - "mapping": { - "properties": { - "mapping": [] - } - } - } - }, - "resource-assignment": { - "type": "component-resource-assignment", - "interfaces": { - "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": { - "operations": { - "process": { - "inputs": { - "template-name": { - "get_input": "template_name" - }, - "template-version": { - "get_input": "template_version" - }, - "action-name": { - "get_input": "action-name" - }, - "resource-type": "vnf-type", - "template-names": [ - "base-config-template", - "licence-template" - ], - "request-id": { - "get_input": "request-id" - }, - "resource-id": { - "get_input": "vnf-id" - } - }, - "outputs": { - "resource-assignment-params": "", - "status": "" - } - } - } - } - }, - "capabilities": { - "component-node": {} - } - }, - "vrr-netconf-device": { - "type": "vnf-netconf-device", - "capabilities": { - "netconf": { - "properties": { - "profile-name": "sample", - "oam-ipv4-address": { - "get_input": "hostname" - }, - "port-number": { - "get_input": "host-port" - }, - "connection-time-out": 30 - } - } - } - }, - "transaction-netconf-baseconfig": { - "type": "component-netconf-executor", - "interfaces": { - "org-openecomp-sdnc-netconf-adaptor-service-NetconfExecutorNode": { - "operations": { - "process": { - "implementation": { - "primary": "file://netconf-adaptor/DefaultGetConfig.py" - }, - "inputs": { - "action-name": { - "get_input": "action-name" - }, - "resource-type": "vnf-type", - "request-id": { - "get_input": "request-id" - }, - "resource-id": { - "get_input": "vnf-id" - }, - "execution-script": "execution-script" - }, - "outputs": { - "response-data": { - "get_attribute": ["SELF", "netconf-executor-baseconfig.response-data"] - }, - "status": { - "get_attribute": ["SELF", "netconf-executor-baseconfig.status"] - } - } - } - } - } - }, - "capabilities": { - "component-node": { - } - }, - "requirements": { - "netconf-connection": { - "capability": "netconf", - "node": "vrr-netconf-device", - "relationship": "tosca.relationships.ConnectsTo" - } - } - } - } - }, - "node_types": { - "dg-resource-assignment": { - "description": "This is Resource Assignment 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" - } - }, - "requirements": { - "component-dependency": { - "capability": "component-node", - "node": "component-resource-assignment", - "relationship": "tosca.relationships.DependsOn" - } - }, - "interfaces": { - "CONFIG": { - "operations": { - "ResourceAssignment": { - "inputs": { - "params": { - "required": false, - "type": "list", - "entry_schema": { - "type": "datatype-property" - } - } - } - } - } - } - }, - "derived_from": "tosca.nodes.DG" - }, - "component-resource-assignment": { - "description": "This is Resource Assignment Component API", - "version": "1.0.0", - "capabilities": { - "component-node": { - "type": "tosca.capabilities.Node" - } - }, - "interfaces": { - "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": { - "operations": { - "process": { - "inputs": { - "action-name": { - "description": "Action Name of the process", - "required": true, - "type": "string" - }, - "template-name": { - "description": "Service Template Name.", - "required": true, - "type": "string" - }, - "template-version": { - "description": "Service Template Version.", - "required": true, - "type": "string" - }, - "resource-type": { - "description": "Request type.", - "required": true, - "type": "string" - }, - "template-names": { - "description": "Name of the artifact Node Templates, to get the template Content.", - "required": true, - "type": "list", - "entry_schema": { - "type": "string" - } - }, - "request-id": { - "description": "Request Id, Unique Id for the request.", - "required": true, - "type": "string" - }, - "resource-id": { - "description": "Resource Id.", - "required": true, - "type": "string" - } - }, - "outputs": { - "resource-assignment-params": { - "required": true, - "type": "string" - }, - "status": { - "required": true, - "type": "string" - } - } - } - } - } - }, - "derived_from": "tosca.nodes.Component" - }, - "artifact-config-template": { - "description": "This is Configuration Velocity Template", - "version": "1.0.0", - "properties": { - "action-names": { - "required": true, - "type": "list", - "entry_schema": { - "type": "string" - } - } - }, - "capabilities": { - "content": { - "type": "tosca.capabilities.Content", - "properties": { - "content": { - "required": true, - "type": "string" - } - } - }, - "mapping": { - "type": "tosca.capabilities.Mapping", - "properties": { - "mapping": { - "required": false, - "type": "list", - "entry_schema": { - "type": "datatype-resource-assignment" - } - } - } - } - }, - "derived_from": "tosca.nodes.Artifact" - }, - "vnf-netconf-device": { - "description": "This is VNF Device with Netconf and SSH Capability", - "version": "1.0.0", - "capabilities": { - "netconf": { - "type": "tosca.capabilities.Netconf", - "properties": { - "profile-name": { - "required": true, - "type": "string" - }, - "oam-ipv4-address": { - "required": true, - "type": "string" - }, - "port-number": { - "required": true, - "type": "integer", - "default": 830 - }, - "connection-time-out": { - "required": false, - "type": "integer", - "default": 30 - } - } - }, - "ssh": { - "type": "tosca.capabilities.Ssh", - "properties": { - "profile-name": { - "required": true, - "type": "string" - }, - "oam-ipv4-address": { - "required": true, - "type": "string" - }, - "port-number": { - "required": true, - "type": "integer", - "default": 22 - }, - "message-time-out": { - "required": false, - "type": "integer", - "default": 3000 - }, - "connection-time-out": { - "required": false, - "type": "integer", - "default": 3000 - } - } - }, - "sftp": { - "type": "tosca.capabilities.Sftp", - "properties": { - "profile-name": { - "required": true, - "type": "string" - }, - "oam-ipv4-address": { - "required": true, - "type": "string" - }, - "port-number": { - "required": true, - "type": "integer", - "default": 22 - }, - "message-time-out": { - "required": false, - "type": "integer", - "default": 3000 - }, - "connection-time-out": { - "required": false, - "type": "integer", - "default": 3000 - } - } - } - }, - "derived_from": "tosca.nodes.Vnf" - }, - "dg-activate-netconf": { - "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" - } - }, - "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" - }, - "component-netconf-executor": { - "description": "This is Netconf Transaction Configuration Component API", - "version": "1.0.0", - "capabilities": { - "component-node": { - "type": "tosca.capabilities.Node" - } - }, - "requirements": { - "netconf-connection": { - "capability": "netconf", - "node": "vnf-netconf-device", - "relationship": "tosca.relationships.ConnectsTo" - } - }, - "interfaces": { - "org-openecomp-sdnc-netconf-adaptor-service-NetconfExecutorNode": { - "operations": { - "process": { - "inputs": { - "request-id": { - "description": "Request Id used to store the generated configuration, in the database along with the template-name", - "required": true, - "type": "string" - }, - "template-name": { - "description": "Service Template Name", - "required": true, - "type": "string" - }, - "template-version": { - "description": "Service Template Version", - "required": true, - "type": "string" - }, - "action-name": { - "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", - "required": false, - "type": "string" - }, - "resource-type": { - "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", - "required": false, - "type": "string" - }, - "resource-id": { - "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", - "required": false, - "type": "string" - }, - "execution-script": { - "description": "Python Script to Execute for this Component action, It should refer any one of Prython Artifact Definition for this Node Template.", - "required": true, - "type": "string" - } - }, - "outputs": { - "response-data": { - "description": "Execution Response Data in JSON format.", - "type": "string" - }, - "status": { - "description": "Status of the Component Execution ( success or failure )", - "required": true, - "type": "string" - } - } - } - } - } - }, - "derived_from": "tosca.nodes.Component" - }, - "tosca.nodes.DG": { - "description": "This is Directed Graph Node Type", - "version": "1.0.0", - "derived_from": "tosca.nodes.Root" - }, - "tosca.nodes.Vnf": { - "description": "This is VNF Node Type", - "version": "1.0.0", - "derived_from": "tosca.nodes.Root" - }, - "tosca.nodes.Artifact": { - "description": "This is Deprecated Artifact Node Type.", - "version": "1.0.0", - "derived_from": "tosca.nodes.Root" - }, - "tosca.nodes.Component": { - "description": "This is default Component Node", - "version": "1.0.0", - "derived_from": "tosca.nodes.Root" - } - }, - "data_types": { - "datatype-resource-assignment": { - "version": "1.0.0", - "description": "This is Resource Assignment Data Type", - "properties": { - "property": { - "required": true, - "type": "datatype-property" - }, - "input-param": { - "required": true, - "type": "boolean" - }, - "dictionary-name": { - "required": false, - "type": "string" - }, - "dictionary-source": { - "required": false, - "type": "string" - }, - "dependencies": { - "required": true, - "type": "list", - "entry_schema": { - "type": "string" - } - }, - "status": { - "required": false, - "type": "string" - }, - "message": { - "required": false, - "type": "string" - }, - "updated-date": { - "required": false, - "type": "string" - }, - "updated-by": { - "required": false, - "type": "string" - } - }, - "derived_from": "tosca.datatypes.Root" - }, - "datatype-property": { - "version": "1.0.0", - "description": "This is Entry point Input Data Type, which is dynamic datatype, The parameter names will be populated during the Design time for each inputs", - "properties": { - "type": { - "required": true, - "type": "string" - }, - "description": { - "required": false, - "type": "string" - }, - "required": { - "required": false, - "type": "boolean" - }, - "default": { - "required": false, - "type": "string" - }, - "entry_schema": { - "required": false, - "type": "string" - } - }, - "derived_from": "tosca.datatypes.Root" - }, - "dt-resource-assignment-request": { - "version": "1.0.0", - "description": "This is Dynamic Data type definition generated from resource mapping for the config template name base-config-template.", - "properties": { - "vnf-id": { - "required": true, - "type": "string" - }, - "group-name": { - "required": true, - "type": "string" - }, - "licence-key": { - "required": true, - "type": "string" - } - }, - "derived_from": "tosca.datatypes.Dynamic" - } - } -} \ No newline at end of file diff --git a/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/TOSCA-Metadata/TOSCA.meta b/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/TOSCA-Metadata/TOSCA.meta deleted file mode 100644 index a4e1df3df..000000000 --- a/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/TOSCA-Metadata/TOSCA.meta +++ /dev/null @@ -1,5 +0,0 @@ -TOSCA-Meta-File-Version: 1.0.0 -CSAR-Version: 1.0 -Created-By: Brinda Santh M -Entry-Definitions: Definitions/vrr-test.json -Template-Tags: vrr-test, Brinda Santh diff --git a/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Templates/base-config-template.vtl b/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Templates/base-config-template.vtl deleted file mode 100644 index 92dba1024..000000000 --- a/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Templates/base-config-template.vtl +++ /dev/null @@ -1,40 +0,0 @@ - - - - ${group-name} - - - <*> - - - - - - 224.0.1.40/32 - - - 224.0.1.39/32 - - - 224.0.0.0/4 - - - - - - - - - - <*> - - 1000 - - - - - - - - - \ No newline at end of file diff --git a/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Templates/licence-template.vtl b/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Templates/licence-template.vtl deleted file mode 100644 index 626974f27..000000000 --- a/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/Templates/licence-template.vtl +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/__init__.py b/ms/controllerblueprints/modules/service/load/blueprints/vrr-test/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt b/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt index 4ab67084a..8d32413f2 100644 --- a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt +++ b/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt @@ -61,7 +61,7 @@ class BluePrintEnhancerServiceImplTest { @Throws(Exception::class) fun testEnhancementAndValidation() { - val basePath = "./../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration" + val basePath = "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" val targetPath = Paths.get("target", "bp-enhance").toUri().path diff --git a/ms/controllerblueprints/modules/service/src/test/resources/application.properties b/ms/controllerblueprints/modules/service/src/test/resources/application.properties index 1c2c1c08b..20450f445 100755 --- a/ms/controllerblueprints/modules/service/src/test/resources/application.properties +++ b/ms/controllerblueprints/modules/service/src/test/resources/application.properties @@ -28,7 +28,7 @@ controllerblueprints.blueprintEnrichmentPath=./target/blueprints/enrichment # Controller Blueprint Load Configurations controllerblueprints.loadInitialData=false controllerblueprints.loadBluePrint=false -controllerblueprints.loadBluePrintPaths=./../../../../components/model-catalog/blueprint-model/starter-blueprint +controllerblueprints.loadBluePrintPaths=./../../../../components/model-catalog/blueprint-model/test-blueprint controllerblueprints.loadModelType=false controllerblueprints.loadModeTypePaths=./../../../../components/model-catalog/definition-type/starter-type controllerblueprints.loadResourceDictionary=false @@ -38,4 +38,4 @@ controllerblueprints.loadResourceDictionaryPaths=./../../../../components/model- controllerblueprints.loadCbaExtension=zip # CBA examples for tests cases -controllerblueprints.loadBlueprintsExamplesPath=./../../../../components/model-catalog/blueprint-model/test-blueprints \ No newline at end of file +controllerblueprints.loadBlueprintsExamplesPath=./../../../../components/model-catalog/blueprint-model/test-blueprint \ No newline at end of file -- cgit 1.2.3-korg From a2fadaccbcdea04f3247b3abb5a2286c51341b5f Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Sat, 9 Feb 2019 18:33:55 -0500 Subject: Multiple fixes & enhancement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rework docker image build - Fix compress function - Fix node type name for source-primary-db Change-Id: Ide38e17036e76047d9f850b714ba0da4add5cd9d Issue-ID: CCSDK-414 Signed-off-by: Alexis de Talhouët --- .../application/etc/SecurityFilterExpressions.cfg | 71 -------------------- .../etc/SecurityFilterExpressionsPool.properties | 22 ------- .../application/etc/logback.xml | 44 ------------- ms/controllerblueprints/application/etc/run.source | 13 ---- .../opt/app/onap/config/application-dev.properties | 70 -------------------- .../opt/app/onap/config/application.properties | 75 ---------------------- .../application/opt/app/onap/config/logback.xml | 44 ------------- .../src/main/resources/application-dev.properties | 2 +- .../src/main/resources/application.properties | 19 +++--- .../application/src/main/resources/logback.xml | 44 +++++++++++++ .../distribution/src/main/dc/docker-compose.yaml | 3 - .../distribution/src/main/docker/Dockerfile | 17 ++--- .../distribution/src/main/docker/distribution.xml | 38 +++-------- .../distribution/src/main/docker/run.source | 13 ++++ .../distribution/src/main/docker/startService.sh | 1 - .../core/utils/BluePrintArchiveUtils.kt | 34 ++-------- .../db/resources/BlueprintCatalogServiceImpl.kt | 2 +- .../service/load/BluePrintCatalogLoadService.kt | 2 +- 18 files changed, 91 insertions(+), 423 deletions(-) delete mode 100644 ms/controllerblueprints/application/etc/SecurityFilterExpressions.cfg delete mode 100644 ms/controllerblueprints/application/etc/SecurityFilterExpressionsPool.properties delete mode 100644 ms/controllerblueprints/application/etc/logback.xml delete mode 100755 ms/controllerblueprints/application/etc/run.source delete mode 100755 ms/controllerblueprints/application/opt/app/onap/config/application-dev.properties delete mode 100755 ms/controllerblueprints/application/opt/app/onap/config/application.properties delete mode 100755 ms/controllerblueprints/application/opt/app/onap/config/logback.xml create mode 100644 ms/controllerblueprints/application/src/main/resources/logback.xml create mode 100755 ms/controllerblueprints/distribution/src/main/docker/run.source (limited to 'ms/controllerblueprints/application/src/main/resources/application-dev.properties') diff --git a/ms/controllerblueprints/application/etc/SecurityFilterExpressions.cfg b/ms/controllerblueprints/application/etc/SecurityFilterExpressions.cfg deleted file mode 100644 index 8185daa0d..000000000 --- a/ms/controllerblueprints/application/etc/SecurityFilterExpressions.cfg +++ /dev/null @@ -1,71 +0,0 @@ -(>)\d{3,4}(<\/.*security>) $1xxxx$2 -(>)\d{11,12}(\d{4}<\/.*creditCardNumber>) $1xxxxxxxxxxxx$2 -(>)\d+(\d{4}<\/.*socialSecurityNumber.*>) $1xxxxx$2 -(>)\d{5}(\d{4}<\/.*ssn>) $1xxxxx$2 -(>)\d*(\d{3}<\/.*idNumber>) $1xxxxxx$2 -(>)\d{11,12}(\d{4}<\/cardNumber>) $1xxxxxxxxxxxx$2 -(>)[^>]*(<\/[^>]*[pP]assword>) $1xxxxxx$2 -(>)\d{3,4}(<\/cvv>) $1xxx$2 -(Card\sNumber\s=\s)\d{11,12}(\d{4}) $1xxxxxxxxxxxx$2 -(CVV\s=\s)... $1xxx -(SSN\s=\s)\d{9} $1xxxxxxxxx -(>)\d{11,12}(\d{4}<\/ccNum>) $1xxxxxxxxxxxx$2 -(>)\d{3,4}(<\/cvvNumber>) $1xxx$2 -(ccNum\s*=\s*)\d{11,12}(\d{4}) $1xxxxxxxxxxxx$2 -(cvvNumber\s*=\s*)\d{3,4} $1xxx$2 -(>).*(<\/passcode>) $1xxxxxx$2 -(password\s*=\s*)\S+ $1xxxxxx -(>)\d{5}(\d{4}<\/.*businessTaxId>) $1xxxxx$2 -(tax_id\sin\srecord=\s)\d{5}(\d{4}) $1xxxxx$2 -(tax_id\sin\srequest=\s)\d{5}(\d{4}) $1xxxxx$2 -(socialSecurityNumber\s*=\s*)\d+(\d{4}) $1xxxxx$2 -(SSN\sin\srecord=)\d+(\d{4}) $1xxxxx$2 -(ssn7\s*)\d+(\d{4}) $1xxxxx$2 -(>)\d+(\d{4}<\/cam:taxId>) $1xxxxx$2 -(>)\d+(\d{4}<\/.*routingNumber>) $1xxxxx$2 -(>)\d+(\d{4}<\/bankTRN>) $1xxxxx$2 -(>)\d+(\d{4}<\/draftAccount>) $1xxxxx$2 -(SSN\sin\srequest\s=)\d+(\d{4}) $1xxxxx$2 -(Input\sto\sCasTux\sCtrl:\sSSN\s)\d+(\d{4}) $1xxxxx$2 -(businessTaxId\s)\d+(\d{4}) $1xxxxx$2 -(InquireSingleCredit\sTax_ID_Input\sin\sresponse=\s)\d+(\d{4}) $1xxxxx$2 -()\d+(\d{4}<\/com:ssNumber>) $1xxxxx$2 -(SsNumber:\s)\d+(\d{4}) $1xxxxx$2 -(BusinessTaxId:\s)\d+(\d{4}) $1xxxxx$2 -().*(<\/acc:passcode>) $1xxxxxx$2 -(>)\d{4}(<\/.*creditCardExpirationDate>) $1xxxx$2 -(birthDate>)\d+(-)\d+(-)\d+(<\/.*birthDate>) $1xxxx$2xx$3xx$4 -(photoIdNumber>)\d+(\d{4}<\/.*photoIdNumber) $1xxxxxxxxxxxxxxx$2 -(socialSecurityNumber>)\d+(\d{4}<\/.*socialSecurityNumber) $1xxxxx$2 -(cardExpirationDate>)\d+(-)\d+(-)\d+(<\/.*cardExpirationDate>) $1xxxx$2xx$3xx$4 -(securityCode>)\d+(<\/.*securityCode>) $1xxxx$2 -(photo_id_nbr>)\d+(\d{4}<\/.*photo_id_nbr) $1xxxxxxxxxxxxxxx$2 -(social_security_nbr>)\d+(\d{4}<\/.*social_security_nbr) $1xxxxx$2 -(birth_date>)\d+(/)\d+(/)\d+(<\/.*birth_date>) $1xx$2xx$3xxxx$4 -(dateOfBirth>)\d+(/)\d+(/)\d+(<\/.*dateOfBirth>) $1xx$2xx$3xxxx$4 -(dateOfBirth>)\d+(-)\d+(-)\d+(<\/.*dateOfBirth>) $1xxxx$2xx$3xx$4 -(dateOfBirth>)\d+(-)\d+(-)\d+(Z<\/.*dateOfBirth>) $1xxxx$2xx$3xx$4 -(dateOfBirth>)\d+(/)\d+(/)\d+(Z<\/.*dateOfBirth>) $1xx$2xx$3xxxx$4 -(>)\w*(\w{3}<\/.*idNumber>) $1xxxxxx$2 -(taxId>)\d+(\d{4}<\/.*taxId>) $1xxxxx$2 -(accountNumber>)\d{12,19}(\d{4}<\/.*accountNumber>) $1xxxxxxxxxxxxxxx$2 -(>)[^>]*(<\/[^>]*ethnicity>) $1xxxxxx$2 -(>)[^>]*(<\/[^>]*RACE>) $1x$2 -(>)[^>]*(<\/[^>]*minority>) $1x$2 -(>)[^>]*(<\/[^>]*MINORITY>) $1x$2 -(BIRTH_DATE>)\d+(-)\d+(-)\d+(<\/.*BIRTH_DATE>) $1xx$2xx$3xxxx$4 -(custom07>)\d+(-)\d+(-)\d+(<\/.*custom07>) $1xx$2xx$3xxxx$4 -(>)\d{11,12}(\d{4}<\/.*creditCardNumber>) $1xxxxxxxxxxxx$2 -(>)\d{3,4}(<\/.*security>) $1xxxx$2 -(>)\d{11,12}(\d{4}<\/.*:.*creditCardNumber>) $1xxxxxxxxxxxx$2 -(>)\d{3,4}(<\/.*:.*security>) $1xxxx$2 -(>)\d{3,4}(<\/.*cVVCode>) $1xxxx$2 -(>)\d{3,4}(<\/.*cVVCode>) $1xxxx$2 -(>)\d{3,4}(<\/.*:.*cVVCode>) $1xxxx$2 -(>).*(<\/userPassword>) $1xxxxxxx$2 -(>).*(<\/.*:userPassword>) $1xxxxxx$2 -(>).*(<\/userPassword>) $1xxxxxxx$2 -(\"userPassword\"\s*:\s*\")(.*?)(\") $1xxxxxx$3 -(\"cng:userPassword\"\s*:\s*\")(.*?)(\") $1xxxxxx$3 -(\"userPassword\"\s*:\s*)(\d+)(,|\s|}|]) $1xxxxxx$3 -(\"cng:userPassword\"\s*:\s*)(\d+)(,|\s|}|]) $1xxxxxx$3 \ No newline at end of file diff --git a/ms/controllerblueprints/application/etc/SecurityFilterExpressionsPool.properties b/ms/controllerblueprints/application/etc/SecurityFilterExpressionsPool.properties deleted file mode 100644 index acfaa4546..000000000 --- a/ms/controllerblueprints/application/etc/SecurityFilterExpressionsPool.properties +++ /dev/null @@ -1,22 +0,0 @@ -# -# 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. -# - -MaxActive=150 -#TimeBetweenEvictionRunsMillis=10 - -#Min and Max idle are only used if TimeBetweenEvictionRunsMillis is set to a value > 0 -#MaxIdle=10 -#MinIdle=5 diff --git a/ms/controllerblueprints/application/etc/logback.xml b/ms/controllerblueprints/application/etc/logback.xml deleted file mode 100644 index 01ae4f6c9..000000000 --- a/ms/controllerblueprints/application/etc/logback.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - ${defaultPattern} - - - - - - - - - - - - - - - diff --git a/ms/controllerblueprints/application/etc/run.source b/ms/controllerblueprints/application/etc/run.source deleted file mode 100755 index 1d0ac0708..000000000 --- a/ms/controllerblueprints/application/etc/run.source +++ /dev/null @@ -1,13 +0,0 @@ -java -classpath "/etc:${APP_HOME}/lib/*:/lib/*:/src:/schema:/generated-sources:${APP_CONFIG_HOME}:${APP_HOME}" \ --DappName=${APPLICATIONNAME} -DappVersion=${BUNDLEVERSION} \ --DrouteOffer=${ROUTEOFFER} \ --DVERSION_ROUTEOFFER_ENVCONTEXT=${BUNDLEVERSION}/${STICKYSELECTORKEY}/${ENVCONTEXT} \ --DSecurityFilePath=/etc \ --DREST_NAME_NORMALIZER_PATTERN_FILE=/etc/PatternInputs.txt \ --Dms_name=org.onap.ccsdk.apps.controllerblueprints \ --Dlogging.config=${APP_CONFIG_HOME}/logback.xml \ --Djava.security.egd=file:/dev/./urandom \ --DAPPNAME=${APP_NAME} -DAPPENV=${APP_ENV} -DAPPVERSION=${APP_VERSION} -DNAMESPACE=${NAMESPACE} \ --Dspring.config.location=${APP_CONFIG_HOME}/ \ --Dblueprints.load.initial-data=${INIT_DATA_LOAD} \ -org.onap.ccsdk.apps.controllerblueprints.ControllerBlueprintsApplication diff --git a/ms/controllerblueprints/application/opt/app/onap/config/application-dev.properties b/ms/controllerblueprints/application/opt/app/onap/config/application-dev.properties deleted file mode 100755 index 1c9029d5b..000000000 --- a/ms/controllerblueprints/application/opt/app/onap/config/application-dev.properties +++ /dev/null @@ -1,70 +0,0 @@ -# -# 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. -# -appName=ControllerBluePrints -ms_name=org.onap.ccsdk.apps.controllerblueprints -appVersion=1.0.0 - -# Basic Authentication -basic-auth.user-name=ccsdkapps -basic-auth.hashed-pwd={bcrypt}$2a$10$MJxhNiOAffxbyrV9.rrOUewP9Q/ASg5Nit2cmP.yBaXGsVXo8BW3y - -#logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr($ threadId: {PID:- }){magenta} %clr(---){faint} %clr([ hostname: %X{hostname} serviceName: %X{serviceName} version: %X{version} transactionId: %X{transactionId} requestTimeStamp: %X{requestTimestamp} responseTimeStamp: %X{responseTimestamp} duration: %X{duration}]){yellow} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex - -logging.level.org.springframework.web=INFO -logging.level.org.hibernate.SQL=warn -logging.level.org.hibernate.type.descriptor.sql=debug - -#To Remove Null in JSON API Response -spring.jackson.default-property-inclusion=non_null - -#Swagger Configuration -swagger.contact.name=Brinda Santh Muthuramalingam -swagger.contact.url=www.onap.com -swagger.contact.email=brindasanth@onap.com - -spring.jpa.properties.hibernate.show_sql=true -spring.jpa.properties.hibernate.use_sql_comments=true -spring.jpa.properties.hibernate.format_sql=true - -# spring.datasource.url, spring.datasource.username,spring.datasource.password may be overridden by ENV variables -spring.datasource.url=jdbc:mysql://localhost:3306/sdnctl -spring.datasource.username=sdnctl -spring.datasource.password=sdnctl -spring.datasource.driver-class-name=org.mariadb.jdbc.Driver -spring.jpa.show-sql=true -spring.jpa.hibernate.ddl-auto=none -spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect -# Load Resource Source Mappings -resourceSourceMappings=primary-db=source-primary-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability -# Controller Blueprints Core Configuration -controllerblueprints.blueprintDeployPath=/etc/blueprints/deploy -controllerblueprints.blueprintArchivePath=/etc/blueprints/archive -controllerblueprints.blueprintEnrichmentPath=/etc/blueprints/enrichment -# Controller Blueprint Load Configurations -controllerblueprints.loadInitialData=true -controllerblueprints.loadBluePrint=false -controllerblueprints.loadBluePrintPaths=./../../../components/model-catalog/blueprint-model/test-blueprint -controllerblueprints.loadModelType=true -controllerblueprints.loadModeTypePaths=./../../../components/model-catalog/definition-type/starter-type -controllerblueprints.loadResourceDictionary=true -controllerblueprints.loadResourceDictionaryPaths=./../../../components/model-catalog/resource-dictionary/starter-dictionary - -# CBA file extension -controllerblueprints.loadCbaExtension=zip - -# Web server config -server.port=8080 \ No newline at end of file diff --git a/ms/controllerblueprints/application/opt/app/onap/config/application.properties b/ms/controllerblueprints/application/opt/app/onap/config/application.properties deleted file mode 100755 index 049d846e6..000000000 --- a/ms/controllerblueprints/application/opt/app/onap/config/application.properties +++ /dev/null @@ -1,75 +0,0 @@ -# -# Copyright © 2017-2018 AT&T Intellectual Property. -# Modifications Copyright © 2018 IBM. -# Modifications Copyright © 2019 Bell Canada. -# -# 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. -# -appName=ControllerBluePrints -ms_name=org.onap.ccsdk.apps.controllerblueprints -appVersion=1.0.0 - -# Basic Authentication -basic-auth.user-name=ccsdkapps -basic-auth.hashed-pwd={bcrypt}$2a$10$MJxhNiOAffxbyrV9.rrOUewP9Q/ASg5Nit2cmP.yBaXGsVXo8BW3y - -#logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr($ threadId: {PID:- }){magenta} %clr(---){faint} %clr([ hostname: %X{hostname} serviceName: %X{serviceName} version: %X{version} transactionId: %X{transactionId} requestTimeStamp: %X{requestTimestamp} responseTimeStamp: %X{responseTimestamp} duration: %X{duration}]){yellow} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex - -logging.level.org.springframework.web=INFO -logging.level.org.hibernate.SQL=warn -logging.level.org.hibernate.type.descriptor.sql=debug - -#To Remove Null in JSON API Response -spring.jackson.default-property-inclusion=non_null - -#Swagger Configuration -swagger.contact.name=Brinda Santh Muthuramalingam -swagger.contact.url=www.onap.com -swagger.contact.email=brindasanth@onap.com - -spring.jpa.properties.hibernate.show_sql=true -spring.jpa.properties.hibernate.use_sql_comments=true -spring.jpa.properties.hibernate.format_sql=true - -# spring.datasource.url, spring.datasource.username,spring.datasource.password may be overridden by ENV variables -spring.datasource.url=jdbc:mysql://db:3306/sdnctl -spring.datasource.username=sdnctl -spring.datasource.password=sdnctl -spring.datasource.driver-class-name=org.mariadb.jdbc.Driver -spring.jpa.show-sql=true -spring.jpa.hibernate.ddl-auto=none -spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect - -# Load Resource Source Mappings -resourceSourceMappings=primary-db=source-primary-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability - -# Controller Blueprints Core Configuration -controllerblueprints.blueprintDeployPath=/etc/blueprints/deploy -controllerblueprints.blueprintArchivePath=/etc/blueprints/archive -controllerblueprints.blueprintEnrichmentPath=/etc/blueprints/enrichment -# Controller Blueprint Load Configurations -# blueprints.load.initial-data may be overridden by ENV variables -controllerblueprints.loadInitialData=true -controllerblueprints.loadBluePrint=false -controllerblueprints.loadBluePrintPaths=/model-catalog/blueprint-model/test-blueprint -controllerblueprints.loadModelType=true -controllerblueprints.loadModeTypePaths=/model-catalog/definition-type/starter-type -controllerblueprints.loadResourceDictionary=true -controllerblueprints.loadResourceDictionaryPaths=/model-catalog/resource-dictionary/starter-dictionary - -# CBA file extension -controllerblueprints.loadCbaExtension=zip - -# Web server config -server.port=8080 \ No newline at end of file diff --git a/ms/controllerblueprints/application/opt/app/onap/config/logback.xml b/ms/controllerblueprints/application/opt/app/onap/config/logback.xml deleted file mode 100755 index 01ae4f6c9..000000000 --- a/ms/controllerblueprints/application/opt/app/onap/config/logback.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - ${defaultPattern} - - - - - - - - - - - - - - - diff --git a/ms/controllerblueprints/application/src/main/resources/application-dev.properties b/ms/controllerblueprints/application/src/main/resources/application-dev.properties index 9a5e75d35..1c9029d5b 100755 --- a/ms/controllerblueprints/application/src/main/resources/application-dev.properties +++ b/ms/controllerblueprints/application/src/main/resources/application-dev.properties @@ -49,7 +49,7 @@ spring.jpa.hibernate.ddl-auto=none spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect # Load Resource Source Mappings -resourceSourceMappings=db=source-db,input=source-input,default=source-default,mdsal=source-rest,capability=source-capability +resourceSourceMappings=primary-db=source-primary-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability # Controller Blueprints Core Configuration controllerblueprints.blueprintDeployPath=/etc/blueprints/deploy controllerblueprints.blueprintArchivePath=/etc/blueprints/archive diff --git a/ms/controllerblueprints/application/src/main/resources/application.properties b/ms/controllerblueprints/application/src/main/resources/application.properties index 0c789364b..034093888 100755 --- a/ms/controllerblueprints/application/src/main/resources/application.properties +++ b/ms/controllerblueprints/application/src/main/resources/application.properties @@ -1,5 +1,6 @@ # # Copyright © 2017-2018 AT&T Intellectual Property. +# Modifications Copyright © 2018 IBM. # Modifications Copyright © 2019 Bell Canada. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,16 +33,16 @@ logging.level.org.hibernate.type.descriptor.sql=debug spring.jackson.default-property-inclusion=non_null #Swagger Configuration -swagger.contact.name=Brinda Santh Muthuramalingam -swagger.contact.url=www.onap.com -swagger.contact.email=brindasanth@onap.com +swagger.contact.name=CCSDK team +swagger.contact.url=www.onap.org +swagger.contact.email=onap-discuss@lists.onap.org spring.jpa.properties.hibernate.show_sql=true spring.jpa.properties.hibernate.use_sql_comments=true spring.jpa.properties.hibernate.format_sql=true # spring.datasource.url, spring.datasource.username,spring.datasource.password may be overridden by ENV variables -spring.datasource.url=jdbc:mysql://localhost:3306/sdnctl +spring.datasource.url=jdbc:mysql://db:3306/sdnctl spring.datasource.username=sdnctl spring.datasource.password=sdnctl spring.datasource.driver-class-name=org.mariadb.jdbc.Driver @@ -51,7 +52,7 @@ spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect # Load Resource Source Mappings -resourceSourceMappings=db=source-db,input=source-input,default=source-default,mdsal=source-rest,capability=source-capability +resourceSourceMappings=primary-db=source-primary-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability # Controller Blueprints Core Configuration controllerblueprints.blueprintDeployPath=/etc/blueprints/deploy @@ -60,12 +61,12 @@ controllerblueprints.blueprintEnrichmentPath=/etc/blueprints/enrichment # Controller Blueprint Load Configurations # blueprints.load.initial-data may be overridden by ENV variables controllerblueprints.loadInitialData=true -controllerblueprints.loadBluePrint=false -controllerblueprints.loadBluePrintPaths=/model-catalog/blueprint-model/test-blueprint +controllerblueprints.loadBluePrint=true +controllerblueprints.loadBluePrintPaths=/opt/app/onap//model-catalog/blueprint-model/service-blueprint controllerblueprints.loadModelType=true -controllerblueprints.loadModeTypePaths=/model-catalog/definition-type/starter-type +controllerblueprints.loadModeTypePaths=/opt/app/onap//model-catalog/definition-type/starter-type controllerblueprints.loadResourceDictionary=true -controllerblueprints.loadResourceDictionaryPaths=/model-catalog/resource-dictionary/starter-dictionary +controllerblueprints.loadResourceDictionaryPaths=/opt/app/onap//model-catalog/resource-dictionary/starter-dictionary # CBA file extension controllerblueprints.loadCbaExtension=zip diff --git a/ms/controllerblueprints/application/src/main/resources/logback.xml b/ms/controllerblueprints/application/src/main/resources/logback.xml new file mode 100644 index 000000000..2db82a128 --- /dev/null +++ b/ms/controllerblueprints/application/src/main/resources/logback.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + ${defaultPattern} + + + + + + + + + + + + + + + diff --git a/ms/controllerblueprints/distribution/src/main/dc/docker-compose.yaml b/ms/controllerblueprints/distribution/src/main/dc/docker-compose.yaml index 232bfc016..450a35415 100755 --- a/ms/controllerblueprints/distribution/src/main/dc/docker-compose.yaml +++ b/ms/controllerblueprints/distribution/src/main/dc/docker-compose.yaml @@ -22,9 +22,6 @@ services: ports: - "8080:8080" restart: always - volumes: - - ~/share/vm_ms/controllerblueprints/config:/opt/app/onap/config - - ~/share/vm_ms/controllerblueprints/logs:/logs environment: APPLICATIONNAME: ControllerBluePrints BUNDLEVERSION: 1.0.0 diff --git a/ms/controllerblueprints/distribution/src/main/docker/Dockerfile b/ms/controllerblueprints/distribution/src/main/docker/Dockerfile index 88577f5af..d3e10b76d 100755 --- a/ms/controllerblueprints/distribution/src/main/docker/Dockerfile +++ b/ms/controllerblueprints/distribution/src/main/docker/Dockerfile @@ -3,19 +3,16 @@ FROM anapsix/alpine-java:8_jdk ENV HTTP_PROXY ${HTTP_PROXY} ENV HTTPS_PROXY ${HTTPS_PROXY} -RUN apk add --no-cache curl - +# add entrypoint +COPY run.source /etc/run.source COPY startService.sh /startService.sh RUN chmod 777 /startService.sh && dos2unix /startService.sh +# add application COPY @project.build.finalName@-@assembly.id@.tar.gz /source.tar.gz - -RUN (mkdir -p /source /opt/app/onap) && (tar -xzf /source.tar.gz -C /source) \ -&& (mv /source/@project.build.finalName@ /source/app) \ -&& (cp -rf /source/app/opt/app/onap/lib /opt/app/onap/) \ -&& (cp -rf /source/app/etc /) \ -&& (cp -rf /source/app/model-catalog /) \ -&& (cp -rf /source/app/config /) \ -&& (rm -rf /source) +RUN tar -xzf /source.tar.gz -C /tmp \ + && cp -rf /tmp/@project.build.finalName@/opt / \ + && rm -rf /source.tar.gz \ + && rm -rf /tmp/@project.build.finalName@ ENTRYPOINT /startService.sh \ No newline at end of file diff --git a/ms/controllerblueprints/distribution/src/main/docker/distribution.xml b/ms/controllerblueprints/distribution/src/main/docker/distribution.xml index 1555b43e7..74dc4400c 100755 --- a/ms/controllerblueprints/distribution/src/main/docker/distribution.xml +++ b/ms/controllerblueprints/distribution/src/main/docker/distribution.xml @@ -17,8 +17,8 @@ --> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd"> ${assembly.id} @@ -27,8 +27,6 @@ /opt/app/onap/lib - - @@ -36,38 +34,18 @@ ${project.basedir}/../application/src/main/resources application.properties + logback.xml - ./ - true - - - ${project.basedir}/src/main/docker - - Dockerfile - startService.sh - - ./ - true - - - ${project.basedir}/../application/src/main/resources - src/main/resources - true - - - ${project.basedir}/../application/etc - ./etc - true - - - ${project.basedir}/../application/opt/app/onap/config - ./config + /opt/app/onap/config true ${project.basedir}/../../../components/model-catalog - ./model-catalog + /opt/app/onap/model-catalog true + + ${project.basedir}/../../../components/model-catalog/proto-definition + diff --git a/ms/controllerblueprints/distribution/src/main/docker/run.source b/ms/controllerblueprints/distribution/src/main/docker/run.source new file mode 100755 index 000000000..1d0ac0708 --- /dev/null +++ b/ms/controllerblueprints/distribution/src/main/docker/run.source @@ -0,0 +1,13 @@ +java -classpath "/etc:${APP_HOME}/lib/*:/lib/*:/src:/schema:/generated-sources:${APP_CONFIG_HOME}:${APP_HOME}" \ +-DappName=${APPLICATIONNAME} -DappVersion=${BUNDLEVERSION} \ +-DrouteOffer=${ROUTEOFFER} \ +-DVERSION_ROUTEOFFER_ENVCONTEXT=${BUNDLEVERSION}/${STICKYSELECTORKEY}/${ENVCONTEXT} \ +-DSecurityFilePath=/etc \ +-DREST_NAME_NORMALIZER_PATTERN_FILE=/etc/PatternInputs.txt \ +-Dms_name=org.onap.ccsdk.apps.controllerblueprints \ +-Dlogging.config=${APP_CONFIG_HOME}/logback.xml \ +-Djava.security.egd=file:/dev/./urandom \ +-DAPPNAME=${APP_NAME} -DAPPENV=${APP_ENV} -DAPPVERSION=${APP_VERSION} -DNAMESPACE=${NAMESPACE} \ +-Dspring.config.location=${APP_CONFIG_HOME}/ \ +-Dblueprints.load.initial-data=${INIT_DATA_LOAD} \ +org.onap.ccsdk.apps.controllerblueprints.ControllerBlueprintsApplication diff --git a/ms/controllerblueprints/distribution/src/main/docker/startService.sh b/ms/controllerblueprints/distribution/src/main/docker/startService.sh index 84b2e5acf..7077c2246 100755 --- a/ms/controllerblueprints/distribution/src/main/docker/startService.sh +++ b/ms/controllerblueprints/distribution/src/main/docker/startService.sh @@ -5,5 +5,4 @@ nodeName=ControllerBlueprints_1.0.0_$(cat /proc/self/cgroup | grep docker | sed echo "APP Config HOME : ${APP_CONFIG_HOME}" export APP_HOME=/opt/app/onap -cp -rf /config /opt/app/onap/ source /etc/run.source diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/BluePrintArchiveUtils.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/BluePrintArchiveUtils.kt index fe7929e85..f6bde1cc5 100755 --- a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/BluePrintArchiveUtils.kt +++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/BluePrintArchiveUtils.kt @@ -37,22 +37,6 @@ class BluePrintArchiveUtils { companion object { private val log = LoggerFactory.getLogger(BluePrintArchiveUtils::class.java) - fun getFileContent(fileName: String): String = runBlocking { - async { - try { - File(fileName).readText(Charsets.UTF_8) - } catch (e: Exception) { - throw BluePrintException("couldn't find file($fileName)") - } - }.await() - } - - fun compress(source: String, destination: String, absolute: Boolean): Boolean { - val rootDir = File(source) - val saveFile = File(destination) - return compress(rootDir, saveFile, absolute) - } - /** * Create a new Zip from a root directory * @@ -63,11 +47,12 @@ class BluePrintArchiveUtils { */ fun compress(source: File, destination: File, absolute: Boolean): Boolean { try { + destination.createNewFile() ZipArchiveOutputStream(destination).use { recurseFiles(source, source, it, absolute) } } catch (e: Exception) { - log.error("Fail to compress folder(:$source) to path(${destination.path}", e) + log.error("Fail to compress folder($source) to path(${destination.path}", e) return false } return true @@ -100,7 +85,10 @@ class BluePrintArchiveUtils { val zae = ZipArchiveEntry(filename) zae.size = file.length() zaos.putArchiveEntry(zae) - FileInputStream(file).use { IOUtils.copy(it, zaos) } + FileInputStream(file).use { + IOUtils.copy(it, zaos) + it.close() + } zaos.closeArchiveEntry() } } @@ -132,16 +120,6 @@ class BluePrintArchiveUtils { return destinationDir } - - /** - * Get the first item in directory - * - * @param zipFile - * @return string - */ - fun getFirstItemInDirectory(dir: File): String { - return dir.walk().map { it.name }.elementAt(1) - } } } \ No newline at end of file diff --git a/ms/controllerblueprints/modules/db-resources/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/db/resources/BlueprintCatalogServiceImpl.kt b/ms/controllerblueprints/modules/db-resources/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/db/resources/BlueprintCatalogServiceImpl.kt index 3ba729d1c..cfde86aac 100644 --- a/ms/controllerblueprints/modules/db-resources/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/db/resources/BlueprintCatalogServiceImpl.kt +++ b/ms/controllerblueprints/modules/db-resources/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/db/resources/BlueprintCatalogServiceImpl.kt @@ -41,7 +41,7 @@ abstract class BlueprintCatalogServiceImpl(private val blueprintValidator: BlueP if (blueprintFile.isDirectory) { extractedDirectory = blueprintFile - archivedDirectory = File(":$blueprintFile.zip") + archivedDirectory = File("$blueprintFile.zip") toDeleteDirectory = archivedDirectory if (!BluePrintArchiveUtils.compress(blueprintFile, archivedDirectory, true)) { diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/load/BluePrintCatalogLoadService.kt b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/load/BluePrintCatalogLoadService.kt index 4fd66ed57..948601cf4 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/load/BluePrintCatalogLoadService.kt +++ b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/load/BluePrintCatalogLoadService.kt @@ -61,7 +61,7 @@ open class BluePrintCatalogLoadService(private val bluePrintCatalogService: Blue try { bluePrintCatalogService.saveToDatabase(file) } catch (e: Exception) { - errorBuilder.appendln("Couldn't load DataType(${file.name}: ${e.message}") + errorBuilder.appendln("Couldn't load BlueprintModel(${file.name}: ${e.message}") } } -- cgit 1.2.3-korg From 3476ae694de004c83600bb7a1a58ee94f9cf9f87 Mon Sep 17 00:00:00 2001 From: vinal patel Date: Wed, 20 Feb 2019 16:02:44 -0500 Subject: Ressource resolution using configurable database Change-Id: I40338a221884d6f4df4c8a7dc3dac1f58f142074 Issue-ID: CCSDK-1092 Signed-off-by: vinal patel --- .../application/src/main/resources/application-dev.properties | 2 +- .../application/src/main/resources/application.properties | 2 +- .../application/src/test/resources/application.properties | 2 +- .../resource/dict/ResourceDictionaryConstants.kt | 2 ++ .../resource/dict/utils/ResourceDictionaryUtilsTest.java | 6 +++--- .../modules/service/src/test/resources/application.properties | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) (limited to 'ms/controllerblueprints/application/src/main/resources/application-dev.properties') diff --git a/ms/controllerblueprints/application/src/main/resources/application-dev.properties b/ms/controllerblueprints/application/src/main/resources/application-dev.properties index 1c9029d5b..3401ece04 100755 --- a/ms/controllerblueprints/application/src/main/resources/application-dev.properties +++ b/ms/controllerblueprints/application/src/main/resources/application-dev.properties @@ -49,7 +49,7 @@ spring.jpa.hibernate.ddl-auto=none spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect # Load Resource Source Mappings -resourceSourceMappings=primary-db=source-primary-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability +resourceSourceMappings=processor-db=source-processor-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability # Controller Blueprints Core Configuration controllerblueprints.blueprintDeployPath=/etc/blueprints/deploy controllerblueprints.blueprintArchivePath=/etc/blueprints/archive diff --git a/ms/controllerblueprints/application/src/main/resources/application.properties b/ms/controllerblueprints/application/src/main/resources/application.properties index 034093888..8789c24ec 100755 --- a/ms/controllerblueprints/application/src/main/resources/application.properties +++ b/ms/controllerblueprints/application/src/main/resources/application.properties @@ -52,7 +52,7 @@ spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect # Load Resource Source Mappings -resourceSourceMappings=primary-db=source-primary-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability +resourceSourceMappings=processor-db=source-processor-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability # Controller Blueprints Core Configuration controllerblueprints.blueprintDeployPath=/etc/blueprints/deploy diff --git a/ms/controllerblueprints/application/src/test/resources/application.properties b/ms/controllerblueprints/application/src/test/resources/application.properties index e0369aea4..8ad9f2c09 100755 --- a/ms/controllerblueprints/application/src/test/resources/application.properties +++ b/ms/controllerblueprints/application/src/test/resources/application.properties @@ -33,7 +33,7 @@ swagger.contact.url=www.onap.com swagger.contact.email=brindasanth@onap.com # Load Resource Source Mappings -resourceSourceMappings=primary-db=source-primary-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability +resourceSourceMappings=processor-db=source-processor-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability # Controller Blueprints Core Configuration controllerblueprints.blueprintDeployPath=./target/blueprints/deploy diff --git a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDictionaryConstants.kt b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDictionaryConstants.kt index d33a2f04b..75368684c 100644 --- a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDictionaryConstants.kt +++ b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/ResourceDictionaryConstants.kt @@ -24,6 +24,8 @@ package org.onap.ccsdk.apps.controllerblueprints.resource.dict object ResourceDictionaryConstants { const val SOURCE_INPUT = "input" const val SOURCE_DEFAULT = "default" + //const val SOURCE_PRIMARY_CONFIG_DATA = "rest" + const val SOURCE_PROCESSOR_DB = "processor-db" const val SOURCE_PRIMARY_CONFIG_DATA = "primary-config-data" const val SOURCE_PRIMARY_DB = "primary-db" diff --git a/ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceDictionaryUtilsTest.java b/ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceDictionaryUtilsTest.java index e4ddac131..45fc739d7 100644 --- a/ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceDictionaryUtilsTest.java +++ b/ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/utils/ResourceDictionaryUtilsTest.java @@ -59,9 +59,9 @@ public class ResourceDictionaryUtilsTest { Assert.assertEquals("Expected First source Default, but.", ResourceDictionaryConstants.SOURCE_DEFAULT, resourceAssignment.getDictionarySource()); // To Check Assigned Source - resourceAssignment.setDictionarySource(ResourceDictionaryConstants.SOURCE_PRIMARY_DB); + resourceAssignment.setDictionarySource(ResourceDictionaryConstants.SOURCE_PROCESSOR_DB); ResourceDictionaryUtils.populateSourceMapping(resourceAssignment, resourceDefinition); - Assert.assertEquals("Expected Assigned source DB, but.", ResourceDictionaryConstants.SOURCE_PRIMARY_DB, resourceAssignment.getDictionarySource()); + Assert.assertEquals("Expected Assigned source DB, but.", ResourceDictionaryConstants.SOURCE_PROCESSOR_DB, resourceAssignment.getDictionarySource()); } @@ -78,7 +78,7 @@ public class ResourceDictionaryUtilsTest { Assert.assertEquals("Expected source Input, but.", ResourceDictionaryConstants.SOURCE_INPUT, inputFirstSource); // TO check the multiple Source - sources.put(ResourceDictionaryConstants.SOURCE_PRIMARY_DB, new NodeTemplate()); + sources.put(ResourceDictionaryConstants.SOURCE_PROCESSOR_DB, new NodeTemplate()); String multipleFirstSource = ResourceDictionaryUtils.findFirstSource(sources); Assert.assertEquals("Expected source Input, but.", ResourceDictionaryConstants.SOURCE_INPUT, multipleFirstSource); diff --git a/ms/controllerblueprints/modules/service/src/test/resources/application.properties b/ms/controllerblueprints/modules/service/src/test/resources/application.properties index 20450f445..011bad32c 100755 --- a/ms/controllerblueprints/modules/service/src/test/resources/application.properties +++ b/ms/controllerblueprints/modules/service/src/test/resources/application.properties @@ -20,7 +20,7 @@ logging.level.org.springframework.web=INFO logging.level.org.hibernate.SQL=warn logging.level.org.hibernate.type.descriptor.sql=debug # Load Resource Source Mappings -resourceSourceMappings=primary-db=source-primary-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability +resourceSourceMappings=processor-db=source-processor-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability # Controller Blueprints Core Configuration controllerblueprints.blueprintDeployPath=./target/blueprints/deploy controllerblueprints.blueprintArchivePath=./target/blueprints/archive -- cgit 1.2.3-korg