\r
**/*versionsBackup\r
**/blackDuckHub*\r
-**/*.jsonld
\ No newline at end of file
+**/*.jsonld\r
+**/.checkstyle\r
+**/.gitignore\r
+**/.gitignore\r
+**/.gitignore\r
+**/.gitignore\r
+**/.gitignore\r
+**/.gitignore\r
+**/.gitignore\r
+**/.gitignore\r
+\r
\r
package org.onap.ccsdk.apps.controllerblueprints.core\r
\r
+import org.onap.ccsdk.apps.controllerblueprints.core.data.PropertyDefinition\r
+\r
/**\r
*\r
*\r
validTypes.add(BluePrintConstants.DATA_TYPE_TIMESTAMP)\r
validTypes.add(BluePrintConstants.DATA_TYPE_NULL)\r
validTypes.add(BluePrintConstants.DATA_TYPE_LIST)\r
+ validTypes.add(BluePrintConstants.DATA_TYPE_MAP)\r
return validTypes\r
}\r
\r
return validTypes\r
}\r
\r
+ @JvmStatic\r
+ fun validPrimitiveOrCollectionPrimitive(propertyDefinition: PropertyDefinition): Boolean {\r
+ val entrySchema = propertyDefinition.entrySchema?.type ?: BluePrintConstants.DATA_TYPE_NULL\r
+ return BluePrintTypes.validPropertyTypes().contains(propertyDefinition.type)\r
+ && BluePrintTypes.validPrimitiveTypes().contains(entrySchema)\r
+ }\r
+\r
@JvmStatic\r
fun validCommands(): List<String> {\r
return listOf(BluePrintConstants.EXPRESSION_GET_INPUT,\r
+++ /dev/null
-/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\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.factory\r
-\r
-import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintEnhancerService\r
-import com.att.eelf.configuration.EELFLogger\r
-import com.att.eelf.configuration.EELFManager\r
-\r
-\r
-/**\r
- * BluePrintEnhancerFactory\r
- * @author Brinda Santh\r
- *\r
- */\r
-\r
-object BluePrintEnhancerFactory {\r
- private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
-\r
- var bluePrintEnhancerServices: MutableMap<String, BluePrintEnhancerService> = HashMap()\r
-\r
- fun register(key: String, bluePrintEnhancerService: BluePrintEnhancerService) {\r
- bluePrintEnhancerServices[key] = bluePrintEnhancerService\r
- }\r
-\r
- /**\r
- * Called by clients to get a Blueprint Parser for the Blueprint parser type\r
- */\r
- fun instance(key: String): BluePrintEnhancerService? {\r
- return bluePrintEnhancerServices.get(key)\r
- }\r
-}\r
}\r
\r
fun nodeTypeInterface(nodeTypeName: String, interfaceName: String): InterfaceDefinition? {\r
- return nodeTypeByName(nodeTypeName).interfaces?.values?.first()\r
+ return nodeTypeByName(nodeTypeName).interfaces?.get(interfaceName)\r
}\r
\r
fun nodeTypeInterfaceOperation(nodeTypeName: String, interfaceName: String, operationName: String): OperationDefinition? {\r
}\r
\r
fun nodeTemplateRequirementNode(nodeTemplateName: String, requirementName: String): NodeTemplate {\r
- val nodeTemplateName: String = nodeTemplateByName(nodeTemplateName).requirements?.get(requirementName)?.node\r
+ val requirementNodeTemplateName: String = nodeTemplateByName(nodeTemplateName).requirements?.get(requirementName)?.node\r
?: throw BluePrintException(String.format("failed to get node name for node template's (%s) requirement's (%s) " + nodeTemplateName, requirementName))\r
- return nodeTemplateByName(nodeTemplateName)\r
+ return nodeTemplateByName(requirementNodeTemplateName)\r
}\r
\r
fun nodeTemplateCapabilityProperty(nodeTemplateName: String, capabilityName: String, propertyName: String): Any? {\r
arrayNode.size() > 3 -> {\r
reqOrCapEntityName = arrayNode[1].textValue()\r
propertyName = arrayNode[2].textValue()\r
- val propertyPaths: List<String> = arrayNode.filterIndexed { index, obj ->\r
+ val propertyPaths: List<String> = arrayNode.filterIndexed { index, _ ->\r
index >= 3\r
}.map { it.textValue() }\r
subProperty = propertyPaths.joinToString("/")\r
interface BluePrintRepoService : Serializable {\r
\r
@Throws(BluePrintException::class)\r
- fun getNodeType(nodeTypeName: String): Mono<NodeType>?\r
+ fun getNodeType(nodeTypeName: String): Mono<NodeType>\r
\r
@Throws(BluePrintException::class)\r
- fun getDataType(dataTypeName: String): Mono<DataType>?\r
+ fun getDataType(dataTypeName: String): Mono<DataType>\r
\r
@Throws(BluePrintException::class)\r
- fun getArtifactType(artifactTypeName: String): Mono<ArtifactType>?\r
+ fun getArtifactType(artifactTypeName: String): Mono<ArtifactType>\r
\r
@Throws(BluePrintException::class)\r
- fun getRelationshipType(relationshipTypeName: String): Mono<RelationshipType>?\r
+ fun getRelationshipType(relationshipTypeName: String): Mono<RelationshipType>\r
\r
@Throws(BluePrintException::class)\r
- fun getCapabilityDefinition(capabilityDefinitionName: String): Mono<CapabilityDefinition>?\r
+ fun getCapabilityDefinition(capabilityDefinitionName: String): Mono<CapabilityDefinition>\r
\r
}\r
\r
private val relationshipTypePath = modelTypePath.plus(BluePrintConstants.PATH_DIVIDER).plus(BluePrintConstants.MODEL_DEFINITION_TYPE_RELATIONSHIP_TYPE)\r
private val extension = ".json"\r
\r
- override fun getDataType(dataTypeName: String): Mono<DataType>? {\r
+ override fun getDataType(dataTypeName: String): Mono<DataType> {\r
val fileName = dataTypePath.plus(BluePrintConstants.PATH_DIVIDER)\r
.plus(dataTypeName).plus(extension)\r
return getModelType(fileName, DataType::class.java)\r
}\r
\r
- override fun getNodeType(nodeTypeName: String): Mono<NodeType>? {\r
+ override fun getNodeType(nodeTypeName: String): Mono<NodeType> {\r
val fileName = nodeTypePath.plus(BluePrintConstants.PATH_DIVIDER).plus(nodeTypeName).plus(extension)\r
return getModelType(fileName, NodeType::class.java)\r
}\r
\r
- override fun getArtifactType(artifactTypeName: String): Mono<ArtifactType>? {\r
+ override fun getArtifactType(artifactTypeName: String): Mono<ArtifactType> {\r
val fileName = artifactTypePath.plus(BluePrintConstants.PATH_DIVIDER)\r
.plus(artifactTypeName).plus(extension)\r
return getModelType(fileName, ArtifactType::class.java)\r
}\r
\r
- override fun getRelationshipType(relationshipTypeName: String): Mono<RelationshipType>? {\r
+ override fun getRelationshipType(relationshipTypeName: String): Mono<RelationshipType> {\r
val fileName = relationshipTypePath.plus(BluePrintConstants.PATH_DIVIDER)\r
.plus(relationshipTypeName).plus(extension)\r
return getModelType(fileName, RelationshipType::class.java)\r
}\r
\r
- override fun getCapabilityDefinition(capabilityDefinitionName: String): Mono<CapabilityDefinition>? {\r
+ override fun getCapabilityDefinition(capabilityDefinitionName: String): Mono<CapabilityDefinition> {\r
val fileName = capabilityTypePath.plus(BluePrintConstants.PATH_DIVIDER)\r
.plus(capabilityDefinitionName).plus(extension)\r
return getModelType(fileName, CapabilityDefinition::class.java)\r
\r
open fun assignWorkflowInputs(workflowName: String, jsonNode: JsonNode) {\r
log.info("assign workflow {} input value ({})", workflowName, jsonNode.toString())\r
- bluePrintContext.workflowByName(workflowName)?.inputs?.forEach { propertyName, property ->\r
+ bluePrintContext.workflowByName(workflowName)?.inputs?.forEach { propertyName, _ ->\r
val valueNode: JsonNode = jsonNode.at(BluePrintConstants.PATH_DIVIDER + propertyName)\r
?: NullNode.getInstance()\r
setWorkflowInputValue(workflowName, propertyName, valueNode)\r
message.appendln("---> Workflow :" + paths.joinToString(separator))\r
// Step Validation Start\r
paths.add("steps")\r
- workflow.steps?.forEach { stepName, step ->\r
+ workflow.steps?.forEach { stepName, _ ->\r
paths.add(stepName)\r
message.appendln("----> Steps :" + paths.joinToString(separator))\r
paths.removeAt(paths.lastIndex)\r
}\r
}\r
\r
- private fun checkPropertyDataType(dataType: String, propertyName: String) {\r
+ private fun checkPropertyDataType(dataTypeName: String, propertyName: String) {\r
\r
- val dataType = serviceTemplate.dataTypes?.get(dataType)\r
- ?: throw BluePrintException(format("DataType ({}) for the property ({}) not found", dataType, propertyName))\r
+ val dataType = serviceTemplate.dataTypes?.get(dataTypeName)\r
+ ?: throw BluePrintException(format("DataType ({}) for the property ({}) not found", dataTypeName, propertyName))\r
\r
checkValidDataTypeDerivedFrom(propertyName, dataType.derivedFrom)\r
\r
if (BluePrintTypes.validPrimitiveTypes().contains(dataType) || checkDataType(dataType)) {\r
return true\r
} else {\r
- throw BluePrintException(format("DataType ({}) for the property ({}) is not valid", dataType))\r
+ throw BluePrintException(format("DataType({}) for the property({}) is not valid", dataType, propertyName))\r
}\r
}\r
\r
\r
fun assignInputs(bluePrintContext: BluePrintContext, jsonNode: JsonNode, context: MutableMap<String, Any>) {\r
log.info("assignInputs from input JSON ({})", jsonNode.toString())\r
- bluePrintContext.inputs?.forEach { propertyName, property ->\r
+ bluePrintContext.inputs?.forEach { propertyName, _ ->\r
val valueNode: JsonNode = jsonNode.at("/".plus(propertyName)) ?: NullNode.getInstance()\r
\r
val path = BluePrintConstants.PATH_INPUTS.plus(BluePrintConstants.PATH_DIVIDER).plus(propertyName)\r
+++ /dev/null
-/*\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.service\r
-\r
-import org.junit.Test\r
-import org.onap.ccsdk.apps.controllerblueprints.core.utils.ServiceTemplateUtils\r
-\r
-/**\r
- * BluePrintEnhancerServiceTest\r
- * @author Brinda Santh\r
- *\r
- */\r
-\r
-class BluePrintEnhancerServiceTest {\r
- val basePath = "load/model_type"\r
-\r
- @Test\r
- fun testEnrichBlueprint() {\r
- val bluePrintEnhancerRepoFileService = BluePrintRepoFileService(basePath)\r
- val bluePrintEnhancerService: BluePrintEnhancerService = BluePrintEnhancerDefaultService(bluePrintEnhancerRepoFileService)\r
-\r
- val serviceTemplate = ServiceTemplateUtils.getServiceTemplate("load/blueprints/simple-baseconfig/Definitions/simple-baseconfig.json")\r
- bluePrintEnhancerService.enhance(serviceTemplate)\r
-\r
- }\r
-}
\ No newline at end of file
\r
@Test\r
fun testGetDataType() {\r
- val dataType = bluePrintEnhancerRepoFileService.getDataType("dt-v4-aggregate")?.block()\r
+ val dataType = bluePrintEnhancerRepoFileService.getDataType("dt-v4-aggregate").block()\r
assertNotNull(dataType, "Failed to get DataType from repo")\r
}\r
\r
@Test\r
fun testGetNodeType() {\r
- val nodeType = bluePrintEnhancerRepoFileService.getNodeType("component-resource-assignment")?.block()\r
+ val nodeType = bluePrintEnhancerRepoFileService.getNodeType("component-resource-assignment").block()\r
assertNotNull(nodeType, "Failed to get NodeType from repo")\r
}\r
\r
@Test\r
fun testGetArtifactType() {\r
- val nodeType = bluePrintEnhancerRepoFileService.getArtifactType("artifact-template-velocity")?.block()\r
+ val nodeType = bluePrintEnhancerRepoFileService.getArtifactType("artifact-template-velocity").block()\r
assertNotNull(nodeType, "Failed to get ArtifactType from repo")\r
}\r
\r
@Test(expected = FileNotFoundException::class)\r
fun testModelNotFound() {\r
- val dataType = bluePrintEnhancerRepoFileService.getDataType("dt-not-found")?.block()\r
+ val dataType = bluePrintEnhancerRepoFileService.getDataType("dt-not-found").block()\r
assertNotNull(dataType, "Failed to get DataType from repo")\r
}\r
}
\ No newline at end of file
/*
* Copyright © 2018 IBM.
+ * Modifications 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.
* Default Source, Database Source, Rest Sources, etc)
*/
interface ResourceSource : Serializable
+
+
+open class ResourceSourceMapping {
+ lateinit var resourceSourceMappings: MutableMap<String, String>
+}
--- /dev/null
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\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.resource.dict.factory\r
+\r
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException\r
+import org.onap.ccsdk.apps.controllerblueprints.core.format\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceSourceMapping\r
+\r
+/**\r
+ * ResourceSourceMappingFactory.\r
+ *\r
+ * @author Brinda Santh\r
+ */\r
+object ResourceSourceMappingFactory {\r
+\r
+ private val resourceSourceMappings: MutableMap<String, String> = hashMapOf()\r
+\r
+ fun registerSourceMapping(sourceInstance: String, nodeTypeName: String) {\r
+ resourceSourceMappings[sourceInstance] = nodeTypeName\r
+ }\r
+\r
+ fun getRegisterSourceMapping(sourceInstance: String): String {\r
+ return resourceSourceMappings[sourceInstance]\r
+ ?: throw BluePrintException(format("failed to get source({}) mapping", sourceInstance))\r
+ }\r
+\r
+ fun getRegisterSourceMapping(): ResourceSourceMapping {\r
+ val resourceSourceMapping = ResourceSourceMapping()\r
+ resourceSourceMapping.resourceSourceMappings = resourceSourceMappings\r
+ return resourceSourceMapping\r
+ }\r
+}\r
+\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.TopologicalSortingUtils
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment
import com.att.eelf.configuration.EELFManager
+import org.onap.ccsdk.apps.controllerblueprints.core.format
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.factory.ResourceSourceMappingFactory
import java.io.Serializable
/**
open fun validateSources(resourceAssignments: List<ResourceAssignment>) {
log.info("validating resource assignment sources")
+ // Check the Resource Assignment Source(Dynamic Instance) is valid.
+ resourceAssignments.forEach { resourceAssignment ->
+ try {
+ ResourceSourceMappingFactory.getRegisterSourceMapping(resourceAssignment.dictionarySource!!)
+ } catch (e: BluePrintException) {
+ validationMessage.appendln(e.message + format(" for resource assignment({})", resourceAssignment.name))
+ }
+ }
}
open fun validateTemplateNDictionaryKeys(resourceAssignments: List<ResourceAssignment>) {
resourceAssignmentMap = resourceAssignments.map { it.name to it }.toMap()
+ // Check the Resource Assignment has Duplicate Key Names
val duplicateKeyNames = resourceAssignments.groupBy { it.name }
.filter { it.value.size > 1 }
.map { it.key }
validationMessage.appendln(String.format("Duplicate Assignment Template Keys (%s) is Present", duplicateKeyNames))
}
+ // Check the Resource Assignment has Duplicate Dictionary Names
val duplicateDictionaryKeyNames = resourceAssignments.groupBy { it.dictionaryName }
.filter { it.value.size > 1 }
.map { it.key }
validationMessage.appendln(String.format("Duplicate Assignment Dictionary Keys (%s) is Present", duplicateDictionaryKeyNames))
}
+ // Collect all the dependencies as a single list
val dependenciesNames = resourceAssignments.mapNotNull { it.dependencies }.flatten()
+ // Check all the dependencies keys have Resource Assignment mappings.
val notPresentDictionaries = dependenciesNames.filter { !resourceAssignmentMap.containsKey(it) }.distinct()
if (notPresentDictionaries.isNotEmpty()) {
validationMessage.appendln(String.format("No assignments for Dictionary Keys (%s)", notPresentDictionaries))
package org.onap.ccsdk.apps.controllerblueprints.resource.dict.service\r
\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants\r
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException\r
import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRepoFileService\r
import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRepoService\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonReactorUtils\r
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceDefinition\r
import reactor.core.publisher.Mono\r
+\r
/**\r
* ResourceDefinitionRepoService.\r
*\r
*/\r
interface ResourceDefinitionRepoService : BluePrintRepoService {\r
\r
+ @Throws(BluePrintException::class)\r
fun getResourceDefinition(resourceDefinitionName: String): Mono<ResourceDefinition>\r
}\r
\r
resourceDefinition.sources.forEach { (name, nodeTemplate) ->
val sourceType = nodeTemplate.type
- val sourceNodeType = bluePrintRepoService.getNodeType(sourceType)?.block()
+ val sourceNodeType = bluePrintRepoService.getNodeType(sourceType).block()
?: throw BluePrintException(format("Failed to get source({}) node type definition({})", name, sourceType))
// Validate Property Name, expression, values and Data Type
isValid = JacksonUtils.checkJsonNodeValueOfCollectionType(propertyType, propertyAssignment)
} else {
- bluePrintRepoService.getDataType(propertyType)
+ bluePrintRepoService.getDataType(propertyType).block()
?: throw BluePrintException(format("property({}) defined of data type({}) is not in repository",
propertyName, propertyType))
isValid = true
--- /dev/null
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\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.resource.dict.utils\r
+\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.factory.ResourceSourceMappingFactory\r
+\r
+object ResourceDictionaryTestUtils {\r
+\r
+ @JvmStatic\r
+ fun setUpResourceSourceMapping() {\r
+ ResourceSourceMappingFactory.registerSourceMapping("db", "source-db")\r
+ ResourceSourceMappingFactory.registerSourceMapping("input", "source-input")\r
+ ResourceSourceMappingFactory.registerSourceMapping("default", "source-default")\r
+ ResourceSourceMappingFactory.registerSourceMapping("mdsal", "source-rest")\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\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.resource.dict.factory;\r
+\r
+import org.junit.Test;\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceSourceMapping;\r
+import org.springframework.util.Assert;\r
+\r
+public class ResourceSourceMappingFactoryTest {\r
+\r
+ @Test\r
+ public void testRegisterResourceMapping() {\r
+\r
+ ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("db", "source-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
+\r
+ ResourceSourceMapping resourceSourceMapping = ResourceSourceMappingFactory.INSTANCE.getRegisterSourceMapping();\r
+ Assert.notNull(resourceSourceMapping, "Failed to get resource source mapping");\r
+ Assert.notNull(resourceSourceMapping.getResourceSourceMappings(), "Failed to get resource source mappings");\r
+\r
+ }\r
+\r
+}\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils\r
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment\r
import com.att.eelf.configuration.EELFManager\r
+import org.junit.Before\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.utils.ResourceDictionaryTestUtils\r
+\r
/**\r
* ResourceAssignmentValidationServiceTest.\r
*\r
*/\r
class ResourceAssignmentValidationServiceTest {\r
private val log: EELFLogger = EELFManager.getInstance().getLogger(ResourceAssignmentValidationServiceTest::class.java)\r
+ @Before\r
+ fun setUp() {\r
+ // Setup dummy Source Instance Mapping\r
+ ResourceDictionaryTestUtils.setUpResourceSourceMapping()\r
+ }\r
+\r
@Test\r
fun testValidateSuccess() {\r
log.info("**************** testValidateSuccess *****************")\r
+++ /dev/null
-[\r
- {\r
- "name": "rs-db-source",\r
- "input-param": true,\r
- "property": {\r
- "type": "string",\r
- "required": true\r
- },\r
- "dictionary-name": "db-source",\r
- "dictionary-source": "db",\r
- "dependencies": [\r
- "input-source"\r
- ]\r
- },\r
- {\r
- "name": "ra-default-source",\r
- "input-param": true,\r
- "property": {\r
- "type": "string",\r
- "required": true\r
- },\r
- "dictionary-name": "default-source",\r
- "dictionary-source": "default",\r
- "dependencies": []\r
- },\r
- {\r
- "name": "ra-input-source",\r
- "input-param": true,\r
- "property": {\r
- "type": "string",\r
- "required": true\r
- },\r
- "dictionary-name": "input-source",\r
- "dictionary-source": "input",\r
- "dependencies": []\r
- }\r
-]\r
/*\r
* Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
import io.swagger.annotations.ApiModelProperty\r
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment\r
\r
-/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\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
/**\r
* BlueprintProcessorData\r
* @author Brinda Santh\r
@get:ApiModelProperty(required=true)\r
lateinit var actionIdentifiers: ActionIdentifiers\r
@get:ApiModelProperty(required=true)\r
- lateinit var resourceAssignments: List<ResourceAssignment>\r
+ lateinit var resourceAssignments: MutableList<ResourceAssignment>\r
@get:ApiModelProperty(required=true )\r
lateinit var payload: ObjectNode\r
}\r
@get:ApiModelProperty(required=true)\r
lateinit var status: Status\r
@get:ApiModelProperty(required=true)\r
- lateinit var resourceAssignments: List<ResourceAssignment>\r
+ lateinit var resourceAssignments: MutableList<ResourceAssignment>\r
}\r
\r
open class ExecutionServiceInput {\r
/*\r
* Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
\r
import com.att.eelf.configuration.EELFManager\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
import org.springframework.context.ApplicationContext\r
import org.springframework.context.ApplicationContextAware\r
import org.springframework.stereotype.Service\r
\r
+/**\r
+ * ComponentNode\r
+ *\r
+ * @author Brinda Santh\r
+ */\r
interface ComponentNode {\r
\r
@Throws(BluePrintProcessorException::class)\r
fun reTrigger(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>)\r
}\r
\r
+/**\r
+ * ComponentNodeFactory\r
+ *\r
+ * @author Brinda Santh\r
+ */\r
@Service\r
-class ComponentNodeFactory : ApplicationContextAware {\r
+open class ComponentNodeFactory : ApplicationContextAware {\r
private val log = EELFManager.getInstance().getLogger(ComponentNodeFactory::class.java)\r
\r
var componentNodes: MutableMap<String, ComponentNode> = hashMapOf()\r
/*\r
* Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
\r
import com.att.eelf.configuration.EELFManager\r
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor\r
-import org.slf4j.Logger\r
-import org.slf4j.LoggerFactory\r
import org.springframework.context.ApplicationContext\r
import org.springframework.context.ApplicationContextAware\r
import org.springframework.stereotype.Service\r
\r
+/**\r
+ * ResourceAssignmentProcessorFactory\r
+ *\r
+ * @author Brinda Santh\r
+ */\r
@Service\r
-class ResourceAssignmentProcessorFactory : ApplicationContextAware {\r
+open class ResourceAssignmentProcessorFactory : ApplicationContextAware {\r
\r
private val log = EELFManager.getInstance().getLogger(ResourceAssignmentProcessorFactory::class.java)\r
\r
--- /dev/null
+/*
+ * 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.blueprintsprocessor.services.execution
+
+import org.onap.ccsdk.apps.blueprintsprocessor.core.factory.ComponentNode
+import org.springframework.stereotype.Component
+
+/**
+ * JavaScriptExecuteComponent
+ *
+ * @author Brinda Santh
+ */
+@Component("component-javascript-executor")
+class JavaScriptExecuteComponent : ComponentNode {
+
+ override fun validate(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun process(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun errorHandle(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun reTrigger(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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.blueprintsprocessor.services.execution
+
+import org.onap.ccsdk.apps.blueprintsprocessor.core.factory.ComponentNode
+import org.springframework.stereotype.Component
+
+/**
+ * PythonExecuteComponent
+ *
+ * @author Brinda Santh
+ */
+@Component("component-python-executor")
+class PythonExecuteComponent : ComponentNode {
+ override fun validate(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun process(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun errorHandle(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun reTrigger(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+}
\ No newline at end of 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
\r
package org.onap.ccsdk.apps.blueprintsprocessor.services.resolution\r
\r
+import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.BlueprintProcessorException\r
+import org.onap.ccsdk.apps.blueprintsprocessor.core.factory.ResourceAssignmentProcessorFactory\r
import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ResourceResolutionInput\r
import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ResourceResolutionOutput\r
import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.Status\r
+import org.onap.ccsdk.apps.controllerblueprints.core.format\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.utils.BulkResourceSequencingUtils\r
import org.springframework.stereotype.Service\r
\r
/**\r
*/\r
\r
@Service\r
-class ResourceResolutionService {\r
+class ResourceResolutionService(private val resourceAssignmentProcessorFactory: ResourceAssignmentProcessorFactory) {\r
\r
fun resolveResource(resourceResolutionInput: ResourceResolutionInput): ResourceResolutionOutput {\r
val resourceResolutionOutput = ResourceResolutionOutput()\r
resourceResolutionOutput.commonHeader = resourceResolutionInput.commonHeader\r
resourceResolutionOutput.resourceAssignments = resourceResolutionInput.resourceAssignments\r
\r
+ val context = hashMapOf<String, Any>()\r
+\r
+ process(resourceResolutionOutput.resourceAssignments, context)\r
+\r
val status = Status()\r
status.code = 200\r
status.message = "Success"\r
\r
return resourceResolutionOutput\r
}\r
+\r
+ fun process(resourceAssignments: MutableList<ResourceAssignment>, context: MutableMap<String, Any>): Unit {\r
+\r
+ val bulkSequenced = BulkResourceSequencingUtils.process(resourceAssignments)\r
+\r
+ bulkSequenced.map { batchResourceAssignments ->\r
+ batchResourceAssignments.filter { it.name != "*" && it.name != "start"}\r
+ .map { resourceAssignment ->\r
+ val dictionarySource = resourceAssignment.dictionarySource\r
+ val processorInstanceName = "resource-assignment-processor-".plus(dictionarySource)\r
+ val resourceAssignmentProcessor = resourceAssignmentProcessorFactory.getInstance(processorInstanceName)\r
+ ?: throw BlueprintProcessorException(format("failed to get resource processor for instance name({}) " +\r
+ "for resource assignment({})", processorInstanceName, resourceAssignment.name))\r
+ try {\r
+ resourceAssignmentProcessor.validate(resourceAssignment, context)\r
+ resourceAssignmentProcessor.process(resourceAssignment, context)\r
+ } catch (e: Exception) {\r
+ resourceAssignmentProcessor.errorHandle(resourceAssignment, context)\r
+ throw BlueprintProcessorException(e)\r
+ }\r
+\r
+ }\r
+ }\r
+ }\r
}\r
/*\r
* Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
\r
package org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor\r
\r
+import com.att.eelf.configuration.EELFManager\r
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment\r
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor\r
import org.springframework.stereotype.Service\r
\r
+/**\r
+ * DefaultResourceAssignmentProcessor\r
+ *\r
+ * @author Brinda Santh\r
+ */\r
@Service("resource-assignment-processor-default")\r
open class DefaultResourceAssignmentProcessor : ResourceAssignmentProcessor {\r
- override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ private val log = EELFManager.getInstance().getLogger(DefaultResourceAssignmentProcessor::class.java)\r
+\r
+ override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
+ log.info("Validation Resource Assignments")\r
}\r
\r
override fun process(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ log.info("Processing Resource Assignments")\r
}\r
\r
- override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
+ log.info("ErrorHandle Resource Assignments")\r
}\r
\r
- override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
+ log.info("Re Trigger Resource Assignments")\r
}\r
}
\ No newline at end of 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
\r
package org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor\r
\r
+import com.att.eelf.configuration.EELFManager\r
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment\r
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor\r
import org.springframework.stereotype.Service\r
\r
+/**\r
+ * InputResourceAssignmentProcessor\r
+ *\r
+ * @author Brinda Santh\r
+ */\r
@Service("resource-assignment-processor-input")\r
open class InputResourceAssignmentProcessor : ResourceAssignmentProcessor {\r
- override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ private val log = EELFManager.getInstance().getLogger(InputResourceAssignmentProcessor::class.java)\r
+\r
+ override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
+ log.info("Validation Resource Assignments")\r
}\r
\r
override fun process(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ log.info("Processing Resource Assignments")\r
}\r
\r
- override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
+ log.info("ErrorHandle Resource Assignments")\r
}\r
\r
- override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
- TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
+ log.info("Re Trigger Resource Assignments")\r
}\r
}
\ No newline at end of file
--- /dev/null
+/*
+ * 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.blueprintsprocessor.services.resolution.processor
+
+import com.att.eelf.configuration.EELFManager
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor
+import org.springframework.stereotype.Service
+
+/**
+ * MDSALResourceAssignmentProcessor
+ *
+ * @author Brinda Santh
+ */
+@Service("resource-assignment-processor-mdsal")
+open class MDSALResourceAssignmentProcessor : ResourceAssignmentProcessor {
+ private val log = EELFManager.getInstance().getLogger(MDSALResourceAssignmentProcessor::class.java)
+
+ override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ log.info("Validation Resource Assignments")
+ }
+
+ override fun process(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ log.info("Processing Resource Assignments")
+ }
+
+ override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ log.info("ErrorHandle Resource Assignments")
+ }
+
+ override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ log.info("Re Trigger Resource Assignments")
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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.blueprintsprocessor.services.resolution.processor
+
+import com.att.eelf.configuration.EELFManager
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor
+import org.springframework.stereotype.Service
+
+/**
+ * SdncResourceAssignmentProcessor
+ *
+ * @author Brinda Santh
+ */
+@Service("resource-assignment-processor-db")
+open class SdncResourceAssignmentProcessor : ResourceAssignmentProcessor {
+
+ private val log = EELFManager.getInstance().getLogger(SdncResourceAssignmentProcessor::class.java)
+
+ override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ log.info("Validation Resource Assignments")
+ }
+
+ override fun process(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ log.info("Processing Resource Assignments")
+ }
+
+ override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ log.info("ErrorHandle Resource Assignments")
+ }
+
+ override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ log.info("Re Trigger Resource Assignments")
+ }
+
+}
\ No newline at end of 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
import org.junit.runner.RunWith;\r
import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ResourceResolutionInput;\r
import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ResourceResolutionOutput;\r
+import org.onap.ccsdk.apps.blueprintsprocessor.core.factory.ResourceAssignmentProcessorFactory;\r
+import org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor.DefaultResourceAssignmentProcessor;\r
+import org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor.InputResourceAssignmentProcessor;\r
+import org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor.MDSALResourceAssignmentProcessor;\r
+import org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor.SdncResourceAssignmentProcessor;\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils;\r
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment;\r
import org.slf4j.Logger;\r
* @author Brinda Santh DATE : 8/15/2018\r
*/\r
@RunWith(SpringRunner.class)\r
-@ContextConfiguration(classes = ResourceResolutionService.class)\r
+@ContextConfiguration(classes = {ResourceResolutionService.class, ResourceAssignmentProcessorFactory.class,\r
+ InputResourceAssignmentProcessor.class, DefaultResourceAssignmentProcessor.class,\r
+ SdncResourceAssignmentProcessor.class, MDSALResourceAssignmentProcessor.class})\r
public class ResourceResolutionServiceTest {\r
private static Logger log = LoggerFactory.getLogger(ResourceResolutionServiceTest.class);\r
\r
String resourceResolutionInputContent = FileUtils.readFileToString(\r
new File("src/test/resources/payload/requests/sample-resourceresolution-request.json"), Charset.defaultCharset());\r
\r
- ResourceResolutionInput resourceResolutionInput = JacksonUtils.readValue(resourceResolutionInputContent, ResourceResolutionInput.class );\r
- Assert.assertNotNull("failed to populate resourceResolutionInput request ",resourceResolutionInput);\r
+ ResourceResolutionInput resourceResolutionInput = JacksonUtils.readValue(resourceResolutionInputContent, ResourceResolutionInput.class);\r
+ Assert.assertNotNull("failed to populate resourceResolutionInput request ", resourceResolutionInput);\r
\r
String resourceAssignmentContent = FileUtils.readFileToString(\r
new File("src/test/resources/mapping/db/resource-assignments-simple.json"), Charset.defaultCharset());\r
Assert.assertTrue("failed to create ResourceAssignment from file", CollectionUtils.isNotEmpty(batchResourceAssignment));\r
resourceResolutionInput.setResourceAssignments(batchResourceAssignment);\r
\r
- ObjectNode inputContent = (ObjectNode)JacksonUtils.jsonNodeFromFile("src/test/resources/payload/inputs/input.json");\r
- Assert.assertNotNull("failed to populate input payload ",inputContent);\r
+ ObjectNode inputContent = (ObjectNode) JacksonUtils.jsonNodeFromFile("src/test/resources/payload/inputs/input.json");\r
+ Assert.assertNotNull("failed to populate input payload ", inputContent);\r
resourceResolutionInput.setPayload(inputContent);\r
log.info("ResourceResolutionInput : {}", JacksonUtils.getJson(resourceResolutionInput, true));\r
\r
ResourceResolutionOutput resourceResolutionOutput = resourceResolutionService.resolveResource(resourceResolutionInput);\r
- Assert.assertNotNull("failed to populate output",resourceResolutionOutput);\r
+ Assert.assertNotNull("failed to populate output", resourceResolutionOutput);\r
\r
}\r
}\r
[\r
- {\r
- "name": "country",\r
- "input-param": true,\r
- "property": {\r
- "type": "string"\r
- },\r
- "dictionary-name": "country",\r
- "dictionary-source": "db",\r
- "dependencies": []\r
- }\r
+ {\r
+ "name": "country",\r
+ "input-param": true,\r
+ "property": {\r
+ "type": "string"\r
+ },\r
+ "dictionary-name": "country",\r
+ "dictionary-source": "db",\r
+ "dependencies": ["state"]\r
+ },\r
+ {\r
+ "name": "state",\r
+ "input-param": true,\r
+ "property": {\r
+ "type": "string"\r
+ },\r
+ "dictionary-name": "state",\r
+ "dictionary-source": "input",\r
+ "dependencies": []\r
+ }\r
]\r
\r
**/*versionsBackup\r
**/blackDuckHub*\r
-**/*.jsonld
\ No newline at end of file
+**/*.jsonld
+/target-ide/
{\r
- "name": "db-source",\r
+ "name": "sample-db-source",\r
"property" :{\r
"description": "name of the ",\r
"type": "string"\r
--- /dev/null
+{\r
+ "tags": "sample-default-source",\r
+ "name": "sample-default-source",\r
+ "property" :{\r
+ "description": "name of the ",\r
+ "type": "string"\r
+ },\r
+ "updated-by": "brindasanth@onap.com",\r
+ "sources": {\r
+ "default": {\r
+ "type": "source-default",\r
+ "properties": {\r
+ }\r
+ }\r
+ }\r
+}
\ No newline at end of file
{\r
- "name": "input-source",\r
+ "name": "sample-input-source",\r
"property" :{\r
"description": "name of the ",\r
"type": "string"\r
},\r
"updated-by": "brindasanth@onap.com",\r
- "tags": "action-name, brindasanth",\r
+ "tags": "sample-input-source",\r
"sources": {\r
"input": {\r
"type": "source-input",\r
"properties": {\r
- "key": "action-name"\r
+ "key": "input-source"\r
}\r
}\r
}\r
--- /dev/null
+{\r
+ "tags": "sample-licenses",\r
+ "name": "sample-licenses",\r
+ "property": {\r
+ "description" : " Sample Data for licences",\r
+ "required": true,\r
+ "type": "list",\r
+ "entry_schema": {\r
+ "type": "dt-license-key"\r
+ }\r
+ },\r
+ "updated-by": "brindasanth@onap.com",\r
+ "sources": {\r
+ "mdsal": {\r
+ "type": "source-rest",\r
+ "properties": {\r
+ "type": "JSON",\r
+ "url-path": "config/L3VNF-API:services/service-list/",\r
+ "path": "/licenses",\r
+ "input-key-mapping": {\r
+ },\r
+ "output-key-mapping": {\r
+ "licenses": "licenses"\r
+ },\r
+ "key-dependencies": []\r
+ }\r
+ }\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+{\r
+ "tags": "sample-mdsal-source",\r
+ "name": "sample-mdsal-source",\r
+ "property": {\r
+ "description": "Sample sample-mdsal-source",\r
+ "type": "string"\r
+ },\r
+ "updated-by": "brindasanth@onap.com",\r
+ "sources": {\r
+ "mdsal": {\r
+ "type": "source-rest",\r
+ "properties": {\r
+ "type": "JSON",\r
+ "url-path": "config/L3VNF-API:services/service-list/$service-instance-id/service-data/vnf-topology-information/vnf-assignments/vnf-vms/$vm-type/vm-networks/$network-role/v4-assigned-ip-list/$v4-ip-type",\r
+ "path": "/v4-assigned-ip-list/0/v4-ip-prefix",\r
+ "input-key-mapping": {\r
+ },\r
+ "output-key-mapping": {\r
+ "mdsal-source": "v4-ip-prefix"\r
+ },\r
+ "key-dependencies": []\r
+ }\r
+ }\r
+ }\r
+}
\ No newline at end of file
{\r
- "name": "v4-ip-type",\r
+ "name": "sample-v4-ip-type",\r
"property": {\r
- "description": "name of the ",\r
+ "description": "sample-v4-ip-type",\r
"type": "string"\r
},\r
"updated-by": "brindasanth@onap.com",\r
- "tags": "v4-ip-type, source-input, brindasanth",\r
+ "tags": "sample-v4-ip-type",\r
"sources": {\r
"input": {\r
"type": "source-input",\r
"properties": {\r
- "key": "v4-ip-type"\r
+ "key": "sample-v4-ip-type"\r
}\r
}\r
}\r
load.nodeTypePath=load/model_type/node_type
load.artifactTypePath=load/model_type/artifact_type
load.resourceDictionaryPath=load/resource_dictionary
-load.blueprintsPath=load/blueprints
\ No newline at end of file
+load.blueprintsPath=load/blueprints
+
+# Load Resource Source Mappings
+resourceSourceMappings=db=source-db,input=source-input,default=source-default,mdsal=source-rest
\ No newline at end of file
</plugin>\r
</plugins>\r
</build>\r
+ \r
+ \r
</project>\r
\r
# See the License for the specific language governing permissions and\r
# limitations under the License.\r
#\r
+spring.main.banner-mode=off\r
+\r
appName=ControllerBluePrints\r
ms_name=org.onap.ccsdk.apps.controllerblueprints\r
appVersion=1.0.0\r
load.nodeTypePath=load/model_type/node_type\r
load.artifactTypePath=load/model_type/artifact_type\r
load.resourceDictionaryPath=load/resource_dictionary\r
-load.blueprintsPath=load/blueprints
\ No newline at end of file
+load.blueprintsPath=load/blueprints\r
+\r
+# Load Resource Source Mappings\r
+resourceSourceMappings=db=source-db,input=source-input,default=source-default,mdsal=source-rest
\ No newline at end of file
<name.space>org.onap.ccsdk.apps</name.space> <!-- <name.space>${namespace}</name.space> -->\r
<serviceArtifactName>controllerblueprints</serviceArtifactName>\r
<image.name>onap/ccsdk-controllerblueprints</image.name>\r
- </properties>\r
+ <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>\r
+ <docker.push.phase>deploy</docker.push.phase>\r
+ <docker.verbose>true</docker.verbose>\r
+ </properties>\r
\r
<dependencies>\r
<dependency>\r
</execution>\r
</executions>\r
</plugin>\r
- <plugin>\r
- <groupId>io.fabric8</groupId>\r
- <artifactId>docker-maven-plugin</artifactId>\r
- <version>0.26.1</version>\r
- <inherited>false</inherited>\r
- <configuration>\r
- <images>\r
- <image>\r
- <name>${image.name}</name>\r
- <build>\r
- <cleanup>try</cleanup>\r
- <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>\r
- <tags>\r
- <tag>${project.version}</tag>\r
- <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>\r
- <tag>${project.docker.latesttag.version}</tag>\r
- </tags>\r
- </build>\r
- </image>\r
- </images>\r
- <verbose>true</verbose>\r
- </configuration>\r
- <executions>\r
- <!--<execution>-->\r
- <!--<id>build-images</id>-->\r
- <!--<phase>package</phase>-->\r
- <!--<goals>-->\r
- <!--<goal>build</goal>-->\r
- <!--</goals>-->\r
- <!--</execution>-->\r
- <execution>\r
- <id>push-images</id>\r
- <phase>deploy</phase>\r
- <goals>\r
- <goal>build</goal>\r
- <goal>push</goal>\r
- </goals>\r
- </execution>\r
- </executions>\r
- </plugin>\r
+\r
</plugins>\r
</build>\r
+\r
+ <profiles>\r
+ <profile>\r
+ <id>docker</id>\r
+ <build>\r
+ <plugins>\r
+ <plugin>\r
+ <groupId>io.fabric8</groupId>\r
+ <artifactId>docker-maven-plugin</artifactId>\r
+ <version>0.26.1</version>\r
+ <inherited>false</inherited>\r
+ <configuration>\r
+ <images>\r
+ <image>\r
+ <name>${image.name}</name>\r
+ <build>\r
+ <cleanup>try</cleanup>\r
+ <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>\r
+ <tags>\r
+ <tag>${project.version}</tag>\r
+ <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>\r
+ <tag>${project.docker.latesttag.version}</tag>\r
+ </tags>\r
+ </build>\r
+ </image>\r
+ </images>\r
+ <verbose>true</verbose>\r
+ </configuration>\r
+ <executions>\r
+ <execution>\r
+ <id>push-images</id>\r
+ <phase>${docker.build.phase}</phase>\r
+ <goals>\r
+ <goal>build</goal>\r
+ <goal>push</goal>\r
+ </goals>\r
+ </execution>\r
+ </executions>\r
+ </plugin>\r
+ </plugins>\r
+ </build>\r
+ </profile>\r
+\r
+ </profiles>\r
</project>\r
\r
<scope>runtime</scope>\r
</dependency>\r
<dependency>\r
- <groupId>org.mariadb.jdbc</groupId>\r
- <artifactId>mariadb-java-client</artifactId>\r
+ <groupId>org.mariadb.jdbc</groupId>\r
+ <artifactId>mariadb-java-client</artifactId>\r
</dependency>\r
<dependency>\r
<groupId>org.powermock</groupId>\r
\r
package org.onap.ccsdk.apps.controllerblueprints.service;\r
\r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
+import org.apache.commons.collections.CollectionUtils;\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.factory.ResourceSourceMappingFactory;\r
+import org.springframework.beans.factory.annotation.Value;\r
import org.springframework.stereotype.Component;\r
\r
import javax.annotation.PostConstruct;\r
+import java.util.List;\r
\r
@Component\r
@SuppressWarnings("unused")\r
public class ApplicationRegistrationService {\r
+ private static EELFLogger log = EELFManager.getInstance().getLogger(ApplicationRegistrationService.class);\r
+\r
+ @Value("#{'${resourceSourceMappings}'.split(',')}")\r
+ private List<String> resourceSourceMappings;\r
\r
@PostConstruct\r
- public void register(){\r
+ public void register() {\r
registerDictionarySources();\r
}\r
\r
- public void registerDictionarySources(){\r
-\r
+ public void registerDictionarySources() {\r
+ log.info("Registering Dictionary Sources : {}", resourceSourceMappings);\r
+ if (CollectionUtils.isNotEmpty(resourceSourceMappings)) {\r
+ resourceSourceMappings.forEach(resourceSourceMapping -> {\r
+ String[] mappingKeyValue = resourceSourceMapping.split("=");\r
+ if (mappingKeyValue != null && mappingKeyValue.length == 2) {\r
+ ResourceSourceMappingFactory.INSTANCE.registerSourceMapping(mappingKeyValue[0].trim(), mappingKeyValue[1].trim());\r
+ } else {\r
+ log.warn("failed to get resource source mapping {}", resourceSourceMapping);\r
+ }\r
+ });\r
+ }\r
}\r
}\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;\r
import org.onap.ccsdk.apps.controllerblueprints.core.ConfigModelConstant;\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.*;\r
-import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintEnhancerDefaultService;\r
-import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRepoService;\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.service.ResourceDefinitionRepoService;\r
+import org.onap.ccsdk.apps.controllerblueprints.service.enhancer.BluePrintEnhancerDefaultService;\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils;\r
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment;\r
import com.att.eelf.configuration.EELFLogger;\r
import com.att.eelf.configuration.EELFManager;\r
+import org.onap.ccsdk.apps.controllerblueprints.service.enhancer.ResourceAssignmentEnhancerService;\r
import org.springframework.stereotype.Service;\r
\r
import java.util.HashMap;\r
\r
private static EELFLogger log = EELFManager.getInstance().getLogger(BluePrintEnhancerService.class);\r
\r
+ private ResourceAssignmentEnhancerService resourceAssignmentEnhancerService;\r
+\r
private Map<String, DataType> recipeDataTypes = new HashMap<>();\r
\r
- public BluePrintEnhancerService(BluePrintRepoService bluePrintEnhancerRepoDBService) {\r
- super(bluePrintEnhancerRepoDBService);\r
+ public BluePrintEnhancerService(ResourceDefinitionRepoService resourceDefinitionRepoService,\r
+ ResourceAssignmentEnhancerService resourceAssignmentEnhancerService) {\r
+ super(resourceDefinitionRepoService);\r
+ this.resourceAssignmentEnhancerService = resourceAssignmentEnhancerService;\r
}\r
\r
@Override\r
- public void enrichTopologyTemplate(@NotNull ServiceTemplate serviceTemplate) throws BluePrintException{\r
+ public void enrichTopologyTemplate(@NotNull ServiceTemplate serviceTemplate) throws BluePrintException {\r
super.enrichTopologyTemplate(serviceTemplate);\r
\r
// Update the Recipe Inputs and DataTypes\r
// Modified for ONAP converted Object to JsonNode\r
JsonNode recipeNames = nodeTemplate.getProperties().get(ConfigModelConstant.PROPERTY_RECIPE_NAMES);\r
\r
- log.info("Processing Receipe Names : {} ", recipeNames);\r
+ log.info("Processing Recipe Names : {} ", recipeNames);\r
\r
if (recipeNames != null && recipeNames.isArray() && recipeNames.size() > 0) {\r
\r
JacksonUtils.getListFromJson(resourceAssignmentContent, ResourceAssignment.class);\r
\r
Preconditions.checkNotNull(resourceAssignments, "Failed to Processing Resource Mapping " + resourceAssignmentContent);\r
+ // Enhance Resource Assignment\r
+ resourceAssignmentEnhancerService.enhanceBluePrint(this, resourceAssignments);\r
+\r
dataTypeProperties = new HashMap<>();\r
\r
for (ResourceAssignment resourceAssignment : resourceAssignments) {\r
&& resourceAssignment.getProperty() != null\r
&& StringUtils.isNotBlank(resourceAssignment.getName())) {\r
\r
- // Enrich the Property Definition\r
- super.enrichPropertyDefinition(resourceAssignment.getName(), resourceAssignment.getProperty());\r
-\r
dataTypeProperties.put(resourceAssignment.getName(), resourceAssignment.getProperty());\r
\r
}\r
import org.jetbrains.annotations.NotNull;\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.*;\r
-import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRepoService;\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils;\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceDefinition;\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.service.ResourceDefinitionRepoService;\r
import org.onap.ccsdk.apps.controllerblueprints.service.domain.ModelType;\r
+import org.onap.ccsdk.apps.controllerblueprints.service.domain.ResourceDictionary;\r
import org.onap.ccsdk.apps.controllerblueprints.service.repository.ModelTypeRepository;\r
+import org.onap.ccsdk.apps.controllerblueprints.service.repository.ResourceDictionaryRepository;\r
import org.springframework.stereotype.Service;\r
import reactor.core.publisher.Mono;\r
\r
import java.util.Optional;\r
\r
/**\r
- * BluePrintRepoDBService\r
+ * ResourceDefinitionRepoDBService\r
*\r
* @author Brinda Santh\r
*/\r
@Service\r
@SuppressWarnings("unused")\r
-public class BluePrintRepoDBService implements BluePrintRepoService {\r
+public class ResourceDefinitionRepoDBService implements ResourceDefinitionRepoService {\r
\r
private ModelTypeRepository modelTypeRepository;\r
+ private ResourceDictionaryRepository resourceDictionaryRepository;\r
+\r
@SuppressWarnings("unused")\r
- public BluePrintRepoDBService(ModelTypeRepository modelTypeRepository) {\r
+ public ResourceDefinitionRepoDBService(ModelTypeRepository modelTypeRepository,\r
+ ResourceDictionaryRepository resourceDictionaryRepository) {\r
this.modelTypeRepository = modelTypeRepository;\r
+ this.resourceDictionaryRepository = resourceDictionaryRepository;\r
}\r
\r
@Override\r
return getModelType(capabilityDefinitionName, CapabilityDefinition.class);\r
}\r
\r
+ @NotNull\r
+ @Override\r
+ public Mono<ResourceDefinition> getResourceDefinition(@NotNull String resourceDefinitionName) throws BluePrintException{\r
+ Optional<ResourceDictionary> dbResourceDictionary = resourceDictionaryRepository.findByName(resourceDefinitionName);\r
+ if(dbResourceDictionary.isPresent()){\r
+ return Mono.just(dbResourceDictionary.get().getDefinition());\r
+ }else{\r
+ throw new BluePrintException(String.format("failed to get resource dictionary (%s) from repo", resourceDefinitionName));\r
+ }\r
+ }\r
+\r
private <T> Mono<T> getModelType(String modelName, Class<T> valueClass) throws BluePrintException {\r
Preconditions.checkArgument(StringUtils.isNotBlank(modelName),\r
"Failed to get model from repo, model name is missing");\r
import org.apache.commons.lang3.StringUtils;\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.PropertyDefinition;\r
-import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils;\r
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceDefinition;\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceSourceMapping;\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.factory.ResourceSourceMappingFactory;\r
import org.onap.ccsdk.apps.controllerblueprints.service.domain.ResourceDictionary;\r
import org.onap.ccsdk.apps.controllerblueprints.service.repository.ResourceDictionaryRepository;\r
import org.onap.ccsdk.apps.controllerblueprints.service.validator.ResourceDictionaryValidator;\r
*/\r
public ResourceDictionary saveResourceDictionary(ResourceDictionary resourceDictionary) {\r
Preconditions.checkNotNull(resourceDictionary, "Resource Dictionary information is missing");\r
- Preconditions.checkNotNull(resourceDictionary.getDefinition(),"Resource Dictionary definition information is missing");\r
+ Preconditions.checkNotNull(resourceDictionary.getDefinition(), "Resource Dictionary definition information is missing");\r
\r
ResourceDefinition resourceDefinition = resourceDictionary.getDefinition();\r
Preconditions.checkNotNull(resourceDefinition, "failed to get resource definition from content");\r
Preconditions.checkArgument(StringUtils.isNotBlank(name), "Resource dictionary Name Information is missing.");\r
resourceDictionaryRepository.deleteByName(name);\r
}\r
+\r
+ /**\r
+ * This is a getResourceSourceMapping service\r
+ *\r
+ */\r
+ public ResourceSourceMapping getResourceSourceMapping() {\r
+ return ResourceSourceMappingFactory.INSTANCE.getRegisterSourceMapping();\r
+ }\r
}\r
package org.onap.ccsdk.apps.controllerblueprints.service.rs;\r
\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceSourceMapping;\r
import org.onap.ccsdk.apps.controllerblueprints.service.ResourceDictionaryService;\r
import org.onap.ccsdk.apps.controllerblueprints.service.domain.ResourceDictionary;\r
import org.springframework.http.MediaType;\r
\r
}\r
\r
+ @GetMapping(path = "/source-mapping", produces = MediaType.APPLICATION_JSON_VALUE)\r
+ public @ResponseBody\r
+ ResourceSourceMapping getResourceSourceMapping() {\r
+ return resourceDictionaryService.getResourceSourceMapping();\r
+ }\r
+\r
}\r
* limitations under the License.\r
*/\r
\r
-package org.onap.ccsdk.apps.controllerblueprints.core.service\r
+package org.onap.ccsdk.apps.controllerblueprints.service.enhancer\r
\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintTypes\r
import org.onap.ccsdk.apps.controllerblueprints.core.format\r
import com.att.eelf.configuration.EELFLogger\r
import com.att.eelf.configuration.EELFManager\r
+import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRepoService\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonReactorUtils\r
import java.io.Serializable\r
\r
}\r
\r
open fun enrichNodeTypeCapabilityProperties(nodeTypeName: String, nodeType: NodeType) {\r
- nodeType.capabilities?.forEach { capabilityDefinitionName, capabilityDefinition ->\r
+ nodeType.capabilities?.forEach { _, capabilityDefinition ->\r
capabilityDefinition.properties?.let { properties ->\r
enrichPropertyDefinitions(properties)\r
}\r
open fun populateNodeType(nodeTypeName: String): NodeType {\r
\r
val nodeType = serviceTemplate.nodeTypes?.get(nodeTypeName)\r
- ?: bluePrintRepoService.getNodeType(nodeTypeName)?.block()\r
+ ?: bluePrintRepoService.getNodeType(nodeTypeName).block()\r
?: throw BluePrintException(format("Couldn't get NodeType({}) from repo.", nodeTypeName))\r
serviceTemplate.nodeTypes?.put(nodeTypeName, nodeType)\r
return nodeType\r
\r
open fun populateArtifactType(artifactTypeName: String): ArtifactType {\r
val artifactType = serviceTemplate.artifactTypes?.get(artifactTypeName)\r
- ?: bluePrintRepoService.getArtifactType(artifactTypeName)?.block()\r
+ ?: bluePrintRepoService.getArtifactType(artifactTypeName).block()\r
?: throw BluePrintException(format("Couldn't get ArtifactType({}) from repo.", artifactTypeName))\r
serviceTemplate.artifactTypes?.put(artifactTypeName, artifactType)\r
return artifactType\r
\r
open fun populateDataTypes(dataTypeName: String): DataType {\r
val dataType = serviceTemplate.dataTypes?.get(dataTypeName)\r
- ?: bluePrintRepoService.getDataType(dataTypeName)?.block()\r
+ ?: bluePrintRepoService.getDataType(dataTypeName).block()\r
?: throw BluePrintException(format("Couldn't get DataType({}) from repo.", dataTypeName))\r
serviceTemplate.dataTypes?.put(dataTypeName, dataType)\r
return dataType\r
* limitations under the License.\r
*/\r
\r
-package org.onap.ccsdk.apps.controllerblueprints.resource.dict.service\r
+package org.onap.ccsdk.apps.controllerblueprints.service.enhancer\r
\r
import com.att.eelf.configuration.EELFLogger\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate\r
-import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintEnhancerDefaultService\r
-import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintEnhancerService\r
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment\r
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceDefinition\r
import com.att.eelf.configuration.EELFManager\r
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintTypes\r
+import org.onap.ccsdk.apps.controllerblueprints.core.format\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceDictionaryConstants\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.factory.ResourceSourceMappingFactory\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.service.ResourceAssignmentValidationDefaultService\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.service.ResourceDefinitionRepoService\r
+import org.springframework.stereotype.Service\r
\r
/**\r
* ResourceAssignmentEnhancerService.\r
*\r
* @author Brinda Santh\r
*/\r
+@Service\r
open class ResourceAssignmentEnhancerDefaultService(private val resourceDefinitionRepoService: ResourceDefinitionRepoService)\r
: ResourceAssignmentEnhancerService {\r
private val log: EELFLogger = EELFManager.getInstance().getLogger(ResourceAssignmentValidationDefaultService::class.java)\r
override fun enhanceBluePrint(bluePrintEnhancerService: BluePrintEnhancerService,\r
resourceAssignments: List<ResourceAssignment>) {\r
\r
+ val uniqueSourceNodeTypeNames = hashSetOf<String>()\r
+\r
// Iterate the Resource Assignment and\r
resourceAssignments.map { resourceAssignment ->\r
val dictionaryName = resourceAssignment.dictionaryName!!\r
val dictionarySource = resourceAssignment.dictionarySource!!\r
- log.info("Enriching Assignment name({}), dictionary name({}), source({})", resourceAssignment.name,\r
+ log.debug("Enriching Assignment name({}), dictionary name({}), source({})", resourceAssignment.name,\r
dictionaryName, dictionarySource)\r
- // Get the Resource Definition from Repo\r
- val resourceDefinition: ResourceDefinition = getResourceDefinition(dictionaryName)\r
+ val sourceNodeTypeName = ResourceSourceMappingFactory.getRegisterSourceMapping(dictionarySource)\r
+\r
+ // Add Unique Node Types\r
+ uniqueSourceNodeTypeNames.add(sourceNodeTypeName)\r
+\r
+ // TODO("Candidate for Optimisation")\r
+ if (checkResourceDefinitionNeeded(resourceAssignment)) {\r
+\r
+ bluePrintEnhancerService.enrichPropertyDefinition(resourceAssignment.name, resourceAssignment.property!!);\r
+\r
+ // Get the Resource Definition from Repo\r
+ val resourceDefinition: ResourceDefinition = getResourceDefinition(dictionaryName)\r
\r
- val sourceNodeTemplate = resourceDefinition.sources.get(dictionarySource)\r
+ val sourceNodeTemplate = resourceDefinition.sources.get(dictionarySource)\r
+ ?: throw BluePrintException(format("failed to get assigned dictionarySource({}) from resourceDefinition({})", dictionarySource, dictionaryName))\r
\r
- // Enrich as NodeTemplate\r
- bluePrintEnhancerService.enrichNodeTemplate(dictionarySource, sourceNodeTemplate!!)\r
+ // Enrich as NodeTemplate\r
+ bluePrintEnhancerService.enrichNodeTemplate(dictionarySource, sourceNodeTemplate)\r
+ }\r
}\r
+ // Enrich the ResourceSource NodeTypes\r
+ uniqueSourceNodeTypeNames.map { nodeTypeName ->\r
+ resourceDefinitionRepoService.getNodeType(nodeTypeName).subscribe { nodeType ->\r
+ bluePrintEnhancerService.enrichNodeType(nodeTypeName, nodeType)\r
+ }\r
+ }\r
+\r
}\r
\r
override fun enhanceBluePrint(resourceAssignments: List<ResourceAssignment>): ServiceTemplate {\r
return bluePrintEnhancerService.serviceTemplate\r
}\r
\r
+ private fun checkResourceDefinitionNeeded(resourceAssignment: ResourceAssignment): Boolean {\r
+ return !((resourceAssignment.dictionarySource.equals(ResourceDictionaryConstants.SOURCE_INPUT)\r
+ || resourceAssignment.dictionarySource.equals(ResourceDictionaryConstants.SOURCE_DEFAULT))\r
+ && BluePrintTypes.validPrimitiveOrCollectionPrimitive(resourceAssignment.property!!))\r
+ }\r
+\r
private fun getResourceDefinition(name: String): ResourceDefinition {\r
- return resourceDefinitionRepoService.getResourceDefinition(name)!!.block()!!\r
+ return resourceDefinitionRepoService.getResourceDefinition(name).block()\r
+ ?: throw BluePrintException(format("failed to get dictionary definition({})", name))\r
}\r
}
\ No newline at end of file
* limitations under the License.\r
*/\r
\r
-package org.onap.ccsdk.apps.controllerblueprints.resource.dict.service;\r
+package org.onap.ccsdk.apps.controllerblueprints.service.enhancer;\r
\r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
import org.junit.Assert;\r
+import org.junit.Before;\r
import org.junit.Test;\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate;\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonReactorUtils;\r
+import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils;\r
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment;\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.service.ResourceDefinitionFileRepoService;\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.service.ResourceDefinitionRepoService;\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.utils.ResourceDictionaryTestUtils;\r
\r
import java.util.List;\r
\r
* @author Brinda Santh\r
*/\r
public class ResourceAssignmentEnhancerServiceTest {\r
+ private static EELFLogger log = EELFManager.getInstance().getLogger(ResourceAssignmentEnhancerServiceTest.class);\r
+\r
+ @Before\r
+ public void setUp(){\r
+ // Setup dummy Source Instance Mapping\r
+ ResourceDictionaryTestUtils.setUpResourceSourceMapping();\r
+ }\r
\r
@Test\r
public void testEnhanceBluePrint() throws BluePrintException {\r
\r
List<ResourceAssignment> resourceAssignments = JacksonReactorUtils\r
- .getListFromClassPathFile("enrich/simple-enrich.json", ResourceAssignment.class).block();\r
+ .getListFromClassPathFile("enhance/enhance-resource-assignment.json", ResourceAssignment.class).block();\r
Assert.assertNotNull("Failed to get Resource Assignment", resourceAssignments);\r
- ResourceDefinitionRepoService resourceDefinitionRepoService = new ResourceDefinitionFileRepoService("load");\r
+ ResourceDefinitionRepoService resourceDefinitionRepoService = new ResourceDefinitionFileRepoService("./../../application/load");\r
ResourceAssignmentEnhancerService resourceAssignmentEnhancerService =\r
new ResourceAssignmentEnhancerDefaultService(resourceDefinitionRepoService);\r
ServiceTemplate serviceTemplate = resourceAssignmentEnhancerService.enhanceBluePrint(resourceAssignments);\r
Assert.assertNotNull("Failed to get Enriched service Template", serviceTemplate);\r
+ log.trace("Enhanced Service Template : {}", JacksonUtils.getJson(serviceTemplate, true));\r
}\r
}\r
\r
/*
* Copyright © 2018 IBM.
+ * Modifications 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.
package org.onap.ccsdk.apps.controllerblueprints.service.repository;
import org.junit.Assert;
-import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runner.RunWith;
@Test
@Commit
public void test01Save() {
- ResourceDefinition resourceDefinition = JacksonUtils.readValueFromFile("./../../application/load/resource_dictionary/db-source" +
+ ResourceDefinition resourceDefinition = JacksonUtils.readValueFromFile("./../../application/load/resource_dictionary/sample-db-source" +
".json", ResourceDefinition.class);
Assert.assertNotNull("Failed to get resourceDefinition from content", resourceDefinition);
resourceDefinition.setName(sourceName);
@Test
@Commit
public void test05Delete() {
- resourceDictionaryReactRepository.deleteByName("db-source").block();
+ resourceDictionaryReactRepository.deleteByName(sourceName).block();
}
private ResourceDictionary transformResourceDictionary(ResourceDefinition resourceDefinition) {
import org.onap.ccsdk.apps.controllerblueprints.TestApplication;\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils;\r
import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceDefinition;\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceSourceMapping;\r
import org.onap.ccsdk.apps.controllerblueprints.service.domain.ResourceDictionary;\r
import com.att.eelf.configuration.EELFLogger;\r
import com.att.eelf.configuration.EELFManager;\r
\r
\r
@RunWith(SpringRunner.class)\r
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)\r
+@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = {"blueprints.load.initial-data=true"})\r
@ContextConfiguration(classes = {TestApplication.class})\r
@FixMethodOrder(MethodSorters.NAME_ASCENDING)\r
public class ResourceDictionaryRestTest {\r
\r
}\r
\r
+ @Test\r
+ public void test03GetResourceSourceMapping() {\r
+ ResourceSourceMapping resourceSourceMapping = resourceDictionaryRest.getResourceSourceMapping();\r
+ org.springframework.util.Assert.notNull(resourceSourceMapping, "Failed to get resource source mapping");\r
+ org.springframework.util.Assert.notNull(resourceSourceMapping.getResourceSourceMappings(), "Failed to get resource source mappings");\r
+ }\r
+\r
}\r
\r
\r
@RunWith(SpringRunner.class)\r
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)\r
+@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = {"blueprints.load.initial-data=true"})\r
@ContextConfiguration(classes = {TestApplication.class})\r
@FixMethodOrder(MethodSorters.NAME_ASCENDING)\r
public class ServiceTemplateRestTest {\r
\r
List<ResourceAssignment> autoMappedResourceAssignment = autoMapResponse.getResourceAssignments();\r
autoMappedResourceAssignment.forEach(resourceAssignment -> {\r
- if ("bundle-id".equals(resourceAssignment.getName())) {\r
+ if ("sample-db-source".equals(resourceAssignment.getName())) {\r
Assert.assertEquals("Failed to assign default first source", "db",\r
resourceAssignment.getDictionarySource());\r
}\r
\r
import org.apache.commons.io.FileUtils;\r
import org.junit.Assert;\r
+import org.junit.Before;\r
import org.junit.Test;\r
import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate;\r
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils;\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.factory.ResourceSourceMappingFactory;\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.utils.ResourceDictionaryTestUtils;\r
import org.onap.ccsdk.apps.controllerblueprints.service.utils.ConfigModelUtils;\r
import com.att.eelf.configuration.EELFLogger;\r
import com.att.eelf.configuration.EELFManager;\r
public class ServiceTemplateValidationTest {\r
private static EELFLogger log = EELFManager.getInstance().getLogger(ServiceTemplateValidationTest.class);\r
\r
+ @Before\r
+ public void setUp(){\r
+ // Setup dummy Source Instance Mapping\r
+ ResourceDictionaryTestUtils.setUpResourceSourceMapping();\r
+ }\r
+\r
@Test\r
public void testBluePrintDirs() {\r
List<String> dirs = ConfigModelUtils.getBlueprintNames("load/blueprints");\r
# See the License for the specific language governing permissions and
# limitations under the License.
#
-
+spring.main.banner-mode=off
spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS = false
logging.level.org.hibernate.type.descriptor.sql=debug
-blueprints.load.initial-data=true
+blueprints.load.initial-data=false
load.dataTypePath=./../../application/load/model_type/data_type
load.nodeTypePath=./../../application/load/model_type/node_type
load.artifactTypePath=./../../application/load/model_type/artifact_type
load.resourceDictionaryPath=./../../application/load/resource_dictionary
-load.blueprintsPath=./../../application/load/blueprints
\ No newline at end of file
+load.blueprintsPath=./../../application/load/blueprints
+
+# Load Resource Source Mappings
+resourceSourceMappings=db=source-db,input=source-input,default=source-default,mdsal=source-rest
\ No newline at end of file
--- /dev/null
+[\r
+ {\r
+ "name": "rs-db-source",\r
+ "input-param": true,\r
+ "property": {\r
+ "type": "string",\r
+ "required": true\r
+ },\r
+ "dictionary-name": "sample-db-source",\r
+ "dictionary-source": "db",\r
+ "dependencies": [\r
+ "input-source"\r
+ ]\r
+ },\r
+ {\r
+ "name": "ra-default-source",\r
+ "input-param": true,\r
+ "property": {\r
+ "type": "string",\r
+ "required": true\r
+ },\r
+ "dictionary-name": "sample-default-source",\r
+ "dictionary-source": "default",\r
+ "dependencies": []\r
+ },\r
+ {\r
+ "name": "ra-input-source",\r
+ "input-param": true,\r
+ "property": {\r
+ "type": "string",\r
+ "required": true\r
+ },\r
+ "dictionary-name": "sample-input-source",\r
+ "dictionary-source": "input",\r
+ "dependencies": []\r
+ },\r
+ {\r
+ "name": "ra-list-input-source",\r
+ "input-param": true,\r
+ "property": {\r
+ "type": "list",\r
+ "required": true,\r
+ "entry_schema": {\r
+ "type": "string"\r
+ }\r
+ },\r
+ "dictionary-name": "ra-list-input-source",\r
+ "dictionary-source": "input",\r
+ "dependencies": []\r
+ },\r
+ {\r
+ "name": "ra-complex-input-source",\r
+ "input-param": true,\r
+ "property": {\r
+ "type": "dt-v4-aggregate",\r
+ "required": true\r
+ },\r
+ "dictionary-name": "sample-mdsal-source",\r
+ "dictionary-source": "mdsal",\r
+ "dependencies": []\r
+ }\r
+]\r
"properties": {\r
"mapping": [\r
{\r
- "name": "bundle-mac",\r
+ "name": "rs-db-source",\r
"property": {\r
"required": true,\r
"type": "string"\r
},\r
"input-param": false,\r
- "dictionary-name": "bundle-mac",\r
+ "dictionary-name": "sample-db-source",\r
"dictionary-source": "db",\r
"dependencies": [\r
"hostname"\r
"version": 0\r
},\r
{\r
- "name": "wan-aggregate-ipv4-addresses",\r
+ "name": "mdsal-source",\r
"property": {\r
"description": "",\r
"required": true,\r
}\r
},\r
"input-param": false,\r
- "dictionary-name": "wan-aggregate-ipv4-addresses",\r
+ "dictionary-name": "sample-mdsal-source",\r
"dictionary-source": "mdsal",\r
"dependencies": [\r
"service-instance-id"\r
}\r
},\r
"input-param": false,\r
- "dictionary-name": "licenses",\r
+ "dictionary-name": "sample-licenses",\r
"dictionary-source": "mdsal",\r
"dependencies": [\r
"service-instance-id"\r
"description" : "This is Dynamic Data type definition generated from resource mapping for the config template name base-config-template.",\r
"version" : "1.0.0",\r
"properties" : {\r
- "bundle-mac" : {\r
- "required" : true,\r
- "type" : "string"\r
- },\r
"hostname" : {\r
"required" : true,\r
"type" : "string"\r
"type" : "dt-license-key"\r
}\r
},\r
- "wan-aggregate-ipv4-addresses" : {\r
- "description" : "",\r
+ "rs-db-source" : {\r
"required" : true,\r
- "type" : "list",\r
- "entry_schema" : {\r
- "type" : "dt-v4-aggregate"\r
- }\r
+ "type" : "string"\r
},\r
"service" : {\r
"required" : true,\r
"service-instance-id" : {\r
"required" : true,\r
"type" : "string"\r
+ },\r
+ "mdsal-source" : {\r
+ "description" : "",\r
+ "required" : true,\r
+ "type" : "list",\r
+ "entry_schema" : {\r
+ "type" : "dt-v4-aggregate"\r
+ }\r
}\r
},\r
"derived_from" : "tosca.datatypes.Dynamic"\r
"version" : "1.0.0",\r
"derived_from" : "tosca.nodes.Root"\r
},\r
+ "artifact-config-template" : {\r
+ "description" : "This is Configuration Velocity Template",\r
+ "version" : "1.0.0",\r
+ "properties" : {\r
+ "action-names" : {\r
+ "required" : true,\r
+ "type" : "list",\r
+ "entry_schema" : {\r
+ "type" : "string"\r
+ }\r
+ }\r
+ },\r
+ "capabilities" : {\r
+ "content" : {\r
+ "type" : "tosca.capabilities.Content",\r
+ "properties" : {\r
+ "content" : {\r
+ "required" : true,\r
+ "type" : "string"\r
+ }\r
+ }\r
+ },\r
+ "mapping" : {\r
+ "type" : "tosca.capabilities.Mapping",\r
+ "properties" : {\r
+ "mapping" : {\r
+ "required" : false,\r
+ "type" : "list",\r
+ "entry_schema" : {\r
+ "type" : "datatype-resource-assignment"\r
+ }\r
+ }\r
+ }\r
+ }\r
+ },\r
+ "derived_from" : "tosca.nodes.Artifact"\r
+ },\r
+ "tosca.nodes.Vnf" : {\r
+ "description" : "This is VNF Node Type",\r
+ "version" : "1.0.0",\r
+ "derived_from" : "tosca.nodes.Root"\r
+ },\r
+ "tosca.nodes.Artifact" : {\r
+ "description" : "This is Deprecated Artifact Node Type.",\r
+ "version" : "1.0.0",\r
+ "derived_from" : "tosca.nodes.Root"\r
+ },\r
+ "dg-activate-netconf" : {\r
+ "description" : "This is Download Netconf Directed Graph",\r
+ "version" : "1.0.0",\r
+ "properties" : {\r
+ "mode" : {\r
+ "required" : false,\r
+ "type" : "string",\r
+ "default" : "sync"\r
+ },\r
+ "version" : {\r
+ "required" : false,\r
+ "type" : "string",\r
+ "default" : "LATEST"\r
+ },\r
+ "is-start-flow" : {\r
+ "required" : false,\r
+ "type" : "boolean",\r
+ "default" : false\r
+ }\r
+ },\r
+ "capabilities" : {\r
+ "dg-node" : {\r
+ "type" : "tosca.capabilities.Node"\r
+ }\r
+ },\r
+ "requirements" : {\r
+ "component-dependency" : {\r
+ "capability" : "component-node",\r
+ "node" : "component-netconf-executor",\r
+ "relationship" : "tosca.relationships.DependsOn"\r
+ }\r
+ },\r
+ "interfaces" : {\r
+ "CONFIG" : {\r
+ "operations" : {\r
+ "ActivateNetconf" : {\r
+ "inputs" : {\r
+ "params" : {\r
+ "required" : false,\r
+ "type" : "list",\r
+ "entry_schema" : {\r
+ "type" : "datatype-property"\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ },\r
+ "derived_from" : "tosca.nodes.DG"\r
+ },\r
+ "source-input" : {\r
+ "description" : "This is Input Resource Source Node Type",\r
+ "version" : "1.0.0",\r
+ "properties" : {\r
+ "key" : {\r
+ "required" : false,\r
+ "type" : "string"\r
+ },\r
+ "key-dependencies" : {\r
+ "required" : true,\r
+ "type" : "list",\r
+ "entry_schema" : {\r
+ "type" : "string"\r
+ }\r
+ }\r
+ },\r
+ "derived_from" : "tosca.nodes.ResourceSource"\r
+ },\r
+ "tosca.nodes.ResourceSource" : {\r
+ "description" : "TOSCA base type for Resource Sources",\r
+ "version" : "1.0.0",\r
+ "derived_from" : "tosca.nodes.Root"\r
+ },\r
"component-resource-assignment" : {\r
"description" : "This is Resource Assignment Component API",\r
"version" : "1.0.0",\r
"version" : "1.0.0",\r
"derived_from" : "tosca.nodes.Root"\r
},\r
- "artifact-config-template" : {\r
- "description" : "This is Configuration Velocity Template",\r
+ "source-db" : {\r
+ "description" : "This is Database Resource Source Node Type",\r
"version" : "1.0.0",\r
"properties" : {\r
- "action-names" : {\r
+ "type" : {\r
"required" : true,\r
- "type" : "list",\r
+ "type" : "string",\r
+ "constraints" : [ {\r
+ "valid_values" : [ "SQL", "PLSQL" ]\r
+ } ]\r
+ },\r
+ "query" : {\r
+ "required" : true,\r
+ "type" : "string"\r
+ },\r
+ "input-key-mapping" : {\r
+ "required" : false,\r
+ "type" : "map",\r
"entry_schema" : {\r
"type" : "string"\r
}\r
- }\r
- },\r
- "capabilities" : {\r
- "content" : {\r
- "type" : "tosca.capabilities.Content",\r
- "properties" : {\r
- "content" : {\r
- "required" : true,\r
- "type" : "string"\r
- }\r
+ },\r
+ "output-key-mapping" : {\r
+ "required" : false,\r
+ "type" : "map",\r
+ "entry_schema" : {\r
+ "type" : "string"\r
}\r
},\r
- "mapping" : {\r
- "type" : "tosca.capabilities.Mapping",\r
- "properties" : {\r
- "mapping" : {\r
- "required" : false,\r
- "type" : "list",\r
- "entry_schema" : {\r
- "type" : "datatype-resource-assignment"\r
- }\r
- }\r
+ "key-dependencies" : {\r
+ "required" : true,\r
+ "type" : "list",\r
+ "entry_schema" : {\r
+ "type" : "string"\r
}\r
}\r
},\r
- "derived_from" : "tosca.nodes.Artifact"\r
+ "derived_from" : "tosca.nodes.ResourceSource"\r
},\r
"vnf-netconf-device" : {\r
"description" : "This is VNF Device with Netconf Capability",\r
},\r
"derived_from" : "tosca.nodes.Vnf"\r
},\r
- "tosca.nodes.Vnf" : {\r
- "description" : "This is VNF Node Type",\r
+ "source-rest" : {\r
+ "description" : "This is Rest Resource Source Node Type",\r
"version" : "1.0.0",\r
- "derived_from" : "tosca.nodes.Root"\r
+ "properties" : {\r
+ "type" : {\r
+ "required" : false,\r
+ "type" : "string",\r
+ "constraints" : [ {\r
+ "valid_values" : [ "JSON" ]\r
+ } ],\r
+ "default" : "JSON"\r
+ },\r
+ "url-path" : {\r
+ "required" : true,\r
+ "type" : "string"\r
+ },\r
+ "path" : {\r
+ "required" : true,\r
+ "type" : "string"\r
+ },\r
+ "expression-type" : {\r
+ "required" : false,\r
+ "type" : "string",\r
+ "constraints" : [ {\r
+ "valid_values" : [ "JSON_PATH", "JSON_POINTER" ]\r
+ } ],\r
+ "default" : "JSON_PATH"\r
+ },\r
+ "input-key-mapping" : {\r
+ "required" : false,\r
+ "type" : "map",\r
+ "entry_schema" : {\r
+ "type" : "string"\r
+ }\r
+ },\r
+ "output-key-mapping" : {\r
+ "required" : false,\r
+ "type" : "map",\r
+ "entry_schema" : {\r
+ "type" : "string"\r
+ }\r
+ },\r
+ "key-dependencies" : {\r
+ "required" : true,\r
+ "type" : "list",\r
+ "entry_schema" : {\r
+ "type" : "string"\r
+ }\r
+ }\r
+ },\r
+ "derived_from" : "tosca.nodes.ResourceSource"\r
},\r
"component-netconf-executor" : {\r
"description" : "This is Netconf Transaction Configuration Component API",\r
}\r
},\r
"derived_from" : "tosca.nodes.Component"\r
- },\r
- "tosca.nodes.Artifact" : {\r
- "description" : "This is Deprecated Artifact Node Type.",\r
- "version" : "1.0.0",\r
- "derived_from" : "tosca.nodes.Root"\r
- },\r
- "dg-activate-netconf" : {\r
- "description" : "This is Download Netconf Directed Graph",\r
- "version" : "1.0.0",\r
- "properties" : {\r
- "mode" : {\r
- "required" : false,\r
- "type" : "string",\r
- "default" : "sync"\r
- },\r
- "version" : {\r
- "required" : false,\r
- "type" : "string",\r
- "default" : "LATEST"\r
- },\r
- "is-start-flow" : {\r
- "required" : false,\r
- "type" : "boolean",\r
- "default" : false\r
- }\r
- },\r
- "capabilities" : {\r
- "dg-node" : {\r
- "type" : "tosca.capabilities.Node"\r
- }\r
- },\r
- "requirements" : {\r
- "component-dependency" : {\r
- "capability" : "component-node",\r
- "node" : "component-netconf-executor",\r
- "relationship" : "tosca.relationships.DependsOn"\r
- }\r
- },\r
- "interfaces" : {\r
- "CONFIG" : {\r
- "operations" : {\r
- "ActivateNetconf" : {\r
- "inputs" : {\r
- "params" : {\r
- "required" : false,\r
- "type" : "list",\r
- "entry_schema" : {\r
- "type" : "datatype-property"\r
- }\r
- }\r
- }\r
- }\r
- }\r
- }\r
- },\r
- "derived_from" : "tosca.nodes.DG"\r
}\r
},\r
"topology_template" : {\r
"mapping" : {\r
"properties" : {\r
"mapping" : [ {\r
- "name" : "bundle-mac",\r
+ "name" : "rs-db-source",\r
"property" : {\r
"required" : true,\r
"type" : "string"\r
},\r
"input-param" : false,\r
- "dictionary-name" : "bundle-mac",\r
+ "dictionary-name" : "sample-db-source",\r
"dictionary-source" : "db",\r
"dependencies" : [ "hostname" ],\r
"version" : 0\r
}, {\r
- "name" : "wan-aggregate-ipv4-addresses",\r
+ "name" : "mdsal-source",\r
"property" : {\r
"description" : "",\r
"required" : true,\r
}\r
},\r
"input-param" : false,\r
- "dictionary-name" : "wan-aggregate-ipv4-addresses",\r
+ "dictionary-name" : "sample-mdsal-source",\r
"dictionary-source" : "mdsal",\r
"dependencies" : [ "service-instance-id" ],\r
"version" : 0\r
}\r
},\r
"input-param" : false,\r
- "dictionary-name" : "licenses",\r
+ "dictionary-name" : "sample-licenses",\r
"dictionary-source" : "mdsal",\r
"dependencies" : [ "service-instance-id" ],\r
"version" : 0\r
<!--
~ Copyright © 2018 IBM.
+ ~ Modifications 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.
</appender>
- <logger name="org.springframework" level="info"/>
- <logger name="org.springframework.web" level="info"/>
+ <logger name="org.springframework" level="warn"/>
+ <logger name="org.springframework.web" level="warn"/>
<logger name="org.hibernate" level="error"/>
<logger name="org.onap.ccsdk.apps" level="info"/>
[\r
{\r
- "name": "input-source"\r
+ "name": "sample-input-source"\r
},\r
{\r
- "name": "v4-ip-type"\r
+ "name": "sample-default-source"\r
},\r
{\r
- "name": "db-source"\r
+ "name": "sample-db-source"\r
+ },\r
+ {\r
+ "name": "sample-mdsal-source"\r
}\r
]
\ No newline at end of file
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<parent>
<groupId>org.onap.ccsdk.apps</groupId>
- <artifactId>ccsdk-apps</artifactId>
+ <artifactId>ccsdk-apps-ms</artifactId>
<version>0.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
- <classpathentry kind="src" output="target-ide/classes" path="opt/etc/config">
+ <classpathentry excluding="**" kind="src" output="target-ide/classes" path="opt/etc/config">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
- <classpathentry kind="src" output="target-ide/classes" path="opt/etc/keystore">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" output="target-ide/classes" path="opt/etc/truststore">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" output="target-ide/classes" path="src/main/resources">
+ <classpathentry excluding="**" kind="src" output="target-ide/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
- <classpathentry kind="src" output="target-ide/test-classes" path="src/test/resources">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" output="target-ide/classes" path="opt/aai/keystore">
+ <classpathentry excluding="**" kind="src" output="target-ide/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
<serviceArtifactName>ms-networkelementnamegen</serviceArtifactName>
<project.version>0.3.0</project.version>
<ccsdk.distribution.version>0.2.4</ccsdk.distribution.version>
+ <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
+ <docker.push.phase>deploy</docker.push.phase>
+ <docker.verbose>true</docker.verbose>
+ <ccsdk.project.version>${project.version}</ccsdk.project.version>
</properties>
<profiles>
</build>
</profile>
+ <profile>
+ <id>docker</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>0.4.11</version>
+ <configuration>
+ <imageName>onap/ccsdk-apps-ms-neng:${project.version}</imageName>
+ <dockerDirectory>src/main/docker</dockerDirectory>
+ <serverId>docker-hub</serverId>
+ <registryUrl>https://${docker.registry}</registryUrl>
+ <imageTags>
+ <imageTag>${project.version}</imageTag>
+ <imageTag>${project.version}-STAGING-${maven.build.timestamp}</imageTag>
+ <imageTag>${project.docker.latesttag.version}</imageTag>
+ </imageTags>
+ <forceTags>true</forceTags>
+ <resources>
+ <resource>
+ <targetPath>/</targetPath>
+ <directory>${project.build.directory}</directory>
+ <include>${project.build.finalName}.jar</include>
+ </resource>
+ <resource>
+ <targetPath>/</targetPath>
+ <directory>${project.build.directory}</directory>
+ <include>opt/etc/config/*</include>
+ </resource>
+ <resource>
+ <targetPath>/</targetPath>
+ <directory>${project.build.directory}</directory>
+ <include>opt/etc/keystore/*</include>
+ </resource>
+ <resource>
+ <targetPath>/</targetPath>
+ <directory>${project.build.directory}</directory>
+ <include>opt/etc/truststore/*</include>
+ </resource>
+ <resource>
+ <targetPath>/</targetPath>
+ <directory>${project.build.directory}</directory>
+ <include>opt/aai/keystore/*</include>
+ </resource>
+ <resource>
+ <targetPath>/</targetPath>
+ <directory>${project.build.directory}</directory>
+ <include>etc/*</include>
+ </resource>
+ </resources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
</profiles>
<developers>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
</dependency>
- <dependency>
- <groupId>org.wisdom-framework</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>5.1.34_1</version>
- </dependency>
+ <dependency>
+ <groupId>org.mariadb.jdbc</groupId>
+ <artifactId>mariadb-java-client</artifactId>
+ <version>${mariadb.connector.version}</version>
+ </dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<build>
<finalName>NetworkElementNameGen</finalName>
<plugins>
+ <plugin>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>
+ println project.properties['ccsdk.project.version'];
+ def versionArray;
+ if (project.properties['ccsdk.project.version'] != null ) {
+ versionArray = project.properties['ccsdk.project.version'].split('\\.');
+ }
+
+ if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
+ {
+ project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
+ } else {
+ project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest";
+ }
+
+ println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
-->
- <plugin>
- <groupId>com.spotify</groupId>
- <artifactId>docker-maven-plugin</artifactId>
- <version>0.4.11</version>
- <configuration>
- <imageName>onap/ccsdk-apps-ms-neng:${project.version}</imageName>
- <dockerDirectory>src/main/docker</dockerDirectory>
- <serverId>docker-hub</serverId>
- <registryUrl>https://${docker.registry}</registryUrl>
- <imageTags>
- <imageTag>${project.version}</imageTag>
- <imageTag>latest</imageTag>
- </imageTags>
- <forceTags>true</forceTags>
- <resources>
- <resource>
- <targetPath>/</targetPath>
- <directory>${project.build.directory}</directory>
- <include>${project.build.finalName}.jar</include>
- </resource>
- <resource>
- <targetPath>/</targetPath>
- <directory>${project.build.directory}</directory>
- <include>opt/etc/config/*</include>
- </resource>
- <resource>
- <targetPath>/</targetPath>
- <directory>${project.build.directory}</directory>
- <include>opt/etc/keystore/*</include>
- </resource>
- <resource>
- <targetPath>/</targetPath>
- <directory>${project.build.directory}</directory>
- <include>opt/etc/truststore/*</include>
- </resource>
- <resource>
- <targetPath>/</targetPath>
- <directory>${project.build.directory}</directory>
- <include>opt/aai/keystore/*</include>
- </resource>
- <resource>
- <targetPath>/</targetPath>
- <directory>${project.build.directory}</directory>
- <include>etc/*</include>
- </resource>
- </resources>
- </configuration>
- </plugin>
+
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugins>
</pluginManagement>
</build>
+
</project>
@Component
@ApplicationPath("/")
public class JerseyConfiguration extends ResourceConfig {
+
+ @Autowired
+ public JerseyConfiguration() {
+ register(RestServiceImpl.class);
+ property(ServletProperties.FILTER_FORWARD_ON_404, true);
+ }
+
/**
* Builds the bean configuring Jackson for JSON serialization.
*/
objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
return objectMapper;
}
-
- @Autowired
- public JerseyConfiguration() {
- register(RestServiceImpl.class);
- property(ServletProperties.FILTER_FORWARD_ON_404, true);
- }
}
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (C) 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
@Transactional(rollbackOn = Exception.class)
public NameGenResponse genNetworkElementName(NameGenRequest request) throws Exception {
try {
- Map<String, Map<String, String>> earlierNames = new HashMap<String, Map<String, String>>();
- List<Map<String, String>> allElements = new ArrayList<Map<String, String>>();
- Map<String, Map<String, ?>> policyCache = new HashMap<String, Map<String, ?>>();
- List<Map<String, String>> generatedNames = new ArrayList<Map<String, String>>();
+ Map<String, Map<String, String>> earlierNames = new HashMap<>();
+ List<Map<String, String>> allElements = new ArrayList<>();
+ Map<String, Map<String, ?>> policyCache = new HashMap<>();
+ List<Map<String, String>> generatedNames = new ArrayList<>();
validateRequest(request);
- if (request.getElements() != null && request.getElements().size() > 0) {
+ if (!request.getElements().isEmpty()) {
allElements.addAll(request.getElements());
}
PolicyFinder policyFinderImpl = findPolicyFinderImpl(request);
void validateRequest(NameGenRequest request) throws Exception {
List<Map<String, String>> elems = request.getElements();
- if (elems != null && elems.size() > 0) {
+ if (!elems.isEmpty()) {
boolean error = false;
Set<String> externalKeySet = elems.stream().map(s -> s.get("external-key")).collect(Collectors.toSet());
if (externalKeySet.size() != request.getElements().size()) {
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (C) 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
import static org.junit.Assert.assertEquals;
+import org.junit.Before;
import org.junit.Test;
import org.onap.ccsdk.apps.ms.neng.core.policy.PolicySequence;
public class SequenceFormatterTest {
+
+ private PolicySequence poly;
+
+ @Before
+ public void setUp()
+ {
+ poly = new PolicySequence();
+ }
+
@Test
public void formatSequence() throws Exception {
- PolicySequence poly = new PolicySequence();
poly.setLength(3);;
assertEquals("001", SequenceFormatter.formatSequence(1, poly));
poly.setLength(2);;
@Test
public void formatSequenceAlpha() throws Exception {
- PolicySequence poly = new PolicySequence();
poly.setLength(3);;
poly.setType(PolicySequence.Type.ALPHA);
assertEquals("001", SequenceFormatter.formatSequence(1, poly));
poly.setLength(4);;
assertEquals("000b", SequenceFormatter.formatSequence(11, poly));
}
+
+ @Test
+ public void testGetSetIncrement()
+ {
+ poly.setIncrement(1L);
+ assertEquals(1L, poly.getIncrement());
+ }
+
+ @Test
+ public void testGetSetMaxValue()
+ {
+ poly.setMaxValue(1L);
+ assertEquals(1L, poly.getMaxValue());
+ }
+
+ @Test
+ public void testGetSetKey()
+ {
+ poly.setKey("testKey");
+ assertEquals("testKey", poly.getKey());
+ }
+
+ @Test
+ public void testGetSetLastReleaseSeqNumTried()
+ {
+ poly.setLastReleaseSeqNumTried(1L);
+ Long expected=1L;
+ assertEquals(expected, poly.getLastReleaseSeqNumTried());
+ }
}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : CCSDK.apps
+ * ================================================================================
+ * Copyright (C) 2018 IBM. All rights reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.ccsdk.apps.ms.neng.persistence.entity;
+
+import java.sql.Timestamp;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestExternalInterface {
+ private ExternalInterface externalInterface;
+
+ @Before
+ public void setUp() {
+ externalInterface = new ExternalInterface();
+ }
+
+ @Test
+ public void testGetSetExternalInteraceId() {
+ externalInterface.setExternalInteraceId(1);
+ Integer expected = 1;
+ Assert.assertEquals(expected, externalInterface.getExternalInteraceId());
+ }
+
+ @Test
+ public void testGetSetSystem() {
+ externalInterface.setSystem("testSystem");
+ Assert.assertEquals("testSystem", externalInterface.getSystem());
+ }
+
+ @Test
+ public void testGetSetParam() {
+ externalInterface.setParam("testParam");
+ Assert.assertEquals("testParam", externalInterface.getParam());
+ }
+
+ @Test
+ public void testGetSetUrlSuffix() {
+ externalInterface.setUrlSuffix("testUrlSuffix");
+ Assert.assertEquals("testUrlSuffix", externalInterface.getUrlSuffix());
+ }
+
+ @Test
+ public void testGetSetTimeStamp() throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
+ Date date = dateFormat.parse("23/09/2007");
+ long time = date.getTime();
+ Timestamp timeStamp = new Timestamp(time);
+ externalInterface.setCreatedTime(timeStamp);
+ Assert.assertEquals(timeStamp, externalInterface.getCreatedTime());
+ }
+
+ @Test
+ public void testGetSetCreatedBy() {
+ externalInterface.setCreatedBy("testUser");
+ Assert.assertEquals("testUser", externalInterface.getCreatedBy());
+ }
+
+ @Test
+ public void testGetSetLastUpdatedTime() throws ParseException {
+ DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
+ Date date = dateFormat.parse("23/09/2007");
+ long time = date.getTime();
+ Timestamp timeStamp = new Timestamp(time);
+ externalInterface.setLastUpdatedTime(timeStamp);
+ Assert.assertEquals(timeStamp, externalInterface.getLastUpdatedTime());
+ }
+
+ @Test
+ public void testGetSetLastUpdatedBy() {
+ externalInterface.setLastUpdatedBy("testUser");
+ Assert.assertEquals("testUser", externalInterface.getLastUpdatedBy());
+ }
+}
<description>Micro-services</description>
<modules>
+ <module>controllerblueprints</module>
<module>neng</module>
- <module>vlantag-api</module>
+ <module>vlantag-api</module>
</modules>
</project>
<swagger.annotations.version>1.5.8</swagger.annotations.version>
<java.version>1.8</java.version>
<springboot.version>2.0.4.RELEASE</springboot.version>
- <mysql.connector.version>5.1.46</mysql.connector.version>
+ <mariadb.connector.version>2.1.1</mariadb.connector.version>
<ccsdk.sli.adaptors.version>0.3.0-SNAPSHOT</ccsdk.sli.adaptors.version>
<docker.registry>TBD:5100</docker.registry>
<serviceArtifactName>vlantagapi</serviceArtifactName>
<sonar.jacoco.itReportPath>${basedir}/target/jacoco-it.exec</sonar.jacoco.itReportPath>
<sonar.language>java</sonar.language>
<ilib.version>2.0.7</ilib.version>
+ <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
+ <docker.push.phase>deploy</docker.push.phase>
+ <docker.verbose>true</docker.verbose>
+ <ccsdk.project.version>${project.version}</ccsdk.project.version>
</properties>
<parent>
- <groupId>org.springframework.boot</groupId>
+ <groupId>org.onap.ccsdk.parent</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
- <version>2.0.4.RELEASE</version>
+ <version>1.1.0-SNAPSHOT</version>
<relativePath />
</parent>
</dependency>
<dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>5.1.46</version>
+ <groupId>org.mariadb.jdbc</groupId>
+ <artifactId>mariadb-java-client</artifactId>
+ <version>${mariadb.connector.version}</version>
</dependency>
<dependency>
<build>
<plugins>
+ <plugin>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>
+ println project.properties['ccsdk.project.version'];
+ def versionArray;
+ if (project.properties['ccsdk.project.version'] != null ) {
+ versionArray = project.properties['ccsdk.project.version'].split('\\.');
+ }
+
+ if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
+ {
+ project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
+ } else {
+ project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest";
+ }
+
+ println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>docker</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>0.4.11</version>
+ <configuration>
+ <imageName>${docker.registry}/org.onap.ccsdk.apps/${serviceArtifactName}</imageName>
+ <dockerDirectory>src/main/docker</dockerDirectory>
+ <serverId>docker-hub</serverId>
+ <registryUrl>https://${docker.registry}</registryUrl>
+ <imageTags>
+ <imageTag>${project.version}</imageTag>
+ <imageTag>${project.version}-STAGING-${maven.build.timestamp}</imageTag>
+ <imageTag>${project.docker.latesttag.version}</imageTag>
+ </imageTags>
+ <forceTags>true</forceTags>
+ <resources>
+ <resource>
+ <targetPath>/</targetPath>
+ <directory>${project.build.directory}</directory>
+ <include>${project.build.finalName}.jar</include>
+ </resource>
+ </resources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
</project>
package org.onap.ccsdk.apps.ms.vlantagapi.core;\r
\r
import org.springframework.boot.SpringApplication;\r
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;\r
import org.springframework.boot.autoconfigure.SpringBootApplication;\r
\r
/**\r
# because they are used in Jenkins, whose plug-in doesn't support
-release_name=1
-sprint_number=1
+release_name=0
+sprint_number=3
feature_revision=0
base_version=${release_name}.${sprint_number}.${feature_revision}