aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--INFO.yaml16
-rw-r--r--cds-ui/client/.gitignore2
-rw-r--r--cds-ui/pom.xml2
-rw-r--r--cds-ui/server/.gitignore1
-rw-r--r--cds-ui/server/pom.xml4
-rw-r--r--cds-ui/server/src/controllers/blueprint-rest.controller.ts15
-rw-r--r--cds-ui/server/src/datasources/blueprint.datasource-template.ts41
-rw-r--r--cds-ui/server/src/services/blueprint.service.ts1
-rwxr-xr-xms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/ControllerBlueprintCatalogServiceImpl.kt127
-rw-r--r--ms/controllerblueprints/modules/blueprint-proto/pom.xml1
-rw-r--r--ms/py-executor/pom.xml1
-rw-r--r--pom.xml2
12 files changed, 67 insertions, 146 deletions
diff --git a/INFO.yaml b/INFO.yaml
index d07760a64..60d073f9e 100644
--- a/INFO.yaml
+++ b/INFO.yaml
@@ -49,6 +49,16 @@ committers:
company: 'IBM'
id: 'brindasanthm'
timezone: 'America/New_York'
+ - name: 'Kevin Smokowski'
+ email: 'ks6305@att.com'
+ company: 'ATT'
+ id: 'nullop'
+ timezone: 'America/New_York'
+ - name: 'Kapil Singal'
+ email: 'kaggarwal@in.ibm.com'
+ company: 'IBM'
+ id: 'kasingal'
+ timezone: 'America/New_York'
repositories:
- ccsdk/cds
tsc:
@@ -63,3 +73,9 @@ tsc:
- type: 'Addition'
name: 'Brinda Santh Muthuramalingam'
link: 'https://lists.onap.org/g/onap-tsc/message/5208'
+ - type: 'Addition'
+ name: 'Kevin Smokowski'
+ link: 'https://lists.onap.org/g/onap-tsc/message/5635'
+ - type: 'Addition'
+ name: 'Kapil Singal'
+ link: 'https://lists.onap.org/g/onap-tsc/message/5635'
diff --git a/cds-ui/client/.gitignore b/cds-ui/client/.gitignore
new file mode 100644
index 000000000..cd7838c5c
--- /dev/null
+++ b/cds-ui/client/.gitignore
@@ -0,0 +1,2 @@
+/target-ide/
+/target/
diff --git a/cds-ui/pom.xml b/cds-ui/pom.xml
index 08c10305b..a95e494d6 100644
--- a/cds-ui/pom.xml
+++ b/cds-ui/pom.xml
@@ -24,7 +24,7 @@ limitations under the License.
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0</version>
<relativePath/>
</parent>
diff --git a/cds-ui/server/.gitignore b/cds-ui/server/.gitignore
new file mode 100644
index 000000000..b83d22266
--- /dev/null
+++ b/cds-ui/server/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/cds-ui/server/pom.xml b/cds-ui/server/pom.xml
index 4c37667a9..fee5c27f4 100644
--- a/cds-ui/server/pom.xml
+++ b/cds-ui/server/pom.xml
@@ -58,8 +58,8 @@ limitations under the License.
<configuration>
<artifactItems>
<artifactItem>
- <groupId>org.onap.ccsdk.cds.components</groupId>
- <artifactId>proto-definition</artifactId>
+ <groupId>org.onap.ccsdk.cds.controllerblueprints</groupId>
+ <artifactId>blueprint-proto</artifactId>
<version>${project.version}</version>
<type>jar</type>
<overWrite>true</overWrite>
diff --git a/cds-ui/server/src/controllers/blueprint-rest.controller.ts b/cds-ui/server/src/controllers/blueprint-rest.controller.ts
index b52952826..49ecb9df1 100644
--- a/cds-ui/server/src/controllers/blueprint-rest.controller.ts
+++ b/cds-ui/server/src/controllers/blueprint-rest.controller.ts
@@ -69,6 +69,21 @@ export class BlueprintRestController {
return await this.bpservice.getAllblueprints();
}
+ @get('/controllerblueprint/paged', {
+ responses: {
+ '200': {
+ description: 'Blueprint model instance with pagination',
+ content: { 'application/json': { schema: { 'x-ts-type': Blueprint } } },
+ },
+ },
+ })
+ async getPagedBlueprints(
+ @param.query.number('limit') limit: number,
+ @param.query.number('offset') offset: number,
+ @param.query.string('sort') sort: string) {
+ return await this.bpservice.getPagedBueprints(limit, offset, sort);
+ }
+
@get('/controllerblueprint/meta-data/{keyword}', {
responses: {
'200': {
diff --git a/cds-ui/server/src/datasources/blueprint.datasource-template.ts b/cds-ui/server/src/datasources/blueprint.datasource-template.ts
index b0aaf01eb..914021887 100644
--- a/cds-ui/server/src/datasources/blueprint.datasource-template.ts
+++ b/cds-ui/server/src/datasources/blueprint.datasource-template.ts
@@ -38,21 +38,36 @@ export default {
}
},
- {
- "template": {
- "method": "GET",
- "url": processorApiConfig.http.url + "/blueprint-model/meta-data/{keyword}",
- "headers": {
- "accepts": "application/json",
- "content-type": "application/json",
- "authorization": processorApiConfig.http.authToken
- },
- "responsePath": "$.*"
+ {
+ "template": {
+ "method": "GET",
+ "url": processorApiConfig.http.url + "/blueprint-model/meta-data/{keyword}",
+ "headers": {
+ "accepts": "application/json",
+ "content-type": "application/json",
+ "authorization": processorApiConfig.http.authToken
},
- "functions": {
- "getBlueprintsByKeyword": ["keyword"]
+ "responsePath": "$.*"
+ },
+ "functions": {
+ "getBlueprintsByKeyword": ["keyword"]
- }
+ }
+ },
+ {
+ "template": {
+ "method": "GET",
+ "url": processorApiConfig.http.url + "/blueprint-model/paged?limit={limit}&offset={offset}&sort={sort}",
+ "headers": {
+ "accepts": "application/json",
+ "content-type": "application/json",
+ "authorization": processorApiConfig.http.authToken
+ },
+ "responsePath": "$",
},
+ "functions": {
+ "getPagedBueprints": ["limit","offset", "sort"],
+ }
+ },
]
};
diff --git a/cds-ui/server/src/services/blueprint.service.ts b/cds-ui/server/src/services/blueprint.service.ts
index 7952859d1..bc93fa1be 100644
--- a/cds-ui/server/src/services/blueprint.service.ts
+++ b/cds-ui/server/src/services/blueprint.service.ts
@@ -6,6 +6,7 @@ export interface BlueprintService {
getAllblueprints(): Promise<any>;
getBlueprintsByKeyword(keyword: string): Promise<any>;
getByTags(tags: string): Promise<JSON>;
+ getPagedBueprints(limit: number, offset: number , sort: string): Promise<any>;
}
export class BlueprintServiceProvider implements Provider<BlueprintService> {
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/ControllerBlueprintCatalogServiceImpl.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/ControllerBlueprintCatalogServiceImpl.kt
deleted file mode 100755
index 5b1d6c36c..000000000
--- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/ControllerBlueprintCatalogServiceImpl.kt
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2019 Bell Canada.
- * Modifications Copyright © 2019 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.cds.blueprintsprocessor.db.primary.service
-
-import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.domain.BlueprintModel
-import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.domain.BlueprintModelContent
-import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.repository.BlueprintModelRepository
-import org.onap.ccsdk.cds.controllerblueprints.core.*
-import org.onap.ccsdk.cds.controllerblueprints.core.common.ApplicationConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration
-import org.onap.ccsdk.cds.controllerblueprints.core.data.ErrorCode
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintValidatorService
-import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BluePrintCompileCache
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintFileUtils
-import org.slf4j.LoggerFactory
-import org.springframework.dao.DataIntegrityViolationException
-import org.springframework.stereotype.Service
-import java.io.File
-import java.nio.file.Files
-import java.nio.file.Path
-import java.util.*
-
-//TODO("Duplicate : Merge BlueprintProcessorCatalogServiceImpl and ControllerBlueprintCatalogServiceImpl")
-/**
- * Similar implementation in [org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintProcessorCatalogServiceImpl]
- */
-@Service("controllerBlueprintsCatalogService")
-class ControllerBlueprintCatalogServiceImpl(bluePrintDesignTimeValidatorService: BluePrintValidatorService,
- private val bluePrintLoadConfiguration: BluePrintLoadConfiguration,
- private val blueprintModelRepository: BlueprintModelRepository)
- : BlueprintCatalogServiceImpl(bluePrintLoadConfiguration, bluePrintDesignTimeValidatorService) {
-
-
- private val log = LoggerFactory.getLogger(ControllerBlueprintCatalogServiceImpl::class.toString())
-
- init {
- log.info("BlueprintProcessorCatalogServiceImpl initialized")
- }
-
- override suspend fun delete(name: String, version: String) {
- // Cleaning Deployed Blueprint
- deleteDir(bluePrintLoadConfiguration.blueprintDeployPath, name, version)
- // Cleaning Data Base
- blueprintModelRepository.deleteByArtifactNameAndArtifactVersion(name, version)
- }
-
- override suspend fun get(name: String, version: String, extract: Boolean): Path? {
- val path = if (extract) {
- normalizedPath(bluePrintLoadConfiguration.blueprintDeployPath, name, version)
- } else {
- normalizedPath(bluePrintLoadConfiguration.blueprintArchivePath, UUID.randomUUID().toString(), "cba.zip")
- }
- blueprintModelRepository.findByArtifactNameAndArtifactVersion(name, version)?.also {
- it.blueprintModelContent.run {
- path.toFile().writeBytes(this!!.content!!).let {
- return path
- }
- }
- }
- return null
- }
-
- override suspend fun save(metadata: MutableMap<String, String>, archiveFile: File) {
-
- val artifactName = metadata[BluePrintConstants.METADATA_TEMPLATE_NAME]
- val artifactVersion = metadata[BluePrintConstants.METADATA_TEMPLATE_VERSION]
-
- check(archiveFile.isFile && !archiveFile.isDirectory) {
- throw BluePrintException("Not a valid Archive file(${archiveFile.absolutePath})")
- }
-
- // cleanup up deploy folder for the Blueprint
- val blueprintDeploy = normalizedPathName(bluePrintLoadConfiguration.blueprintDeployPath,
- artifactName, artifactVersion)
- val cacheKey = BluePrintFileUtils.compileCacheKey(blueprintDeploy)
- BluePrintCompileCache.cleanClassLoader(cacheKey)
-
- blueprintModelRepository.findByArtifactNameAndArtifactVersion(artifactName!!, artifactVersion!!)?.let {
- log.info("Overwriting blueprint model :$artifactName::$artifactVersion")
- blueprintModelRepository.deleteByArtifactNameAndArtifactVersion(artifactName, artifactVersion)
- }
-
- val blueprintModel = BlueprintModel()
- blueprintModel.id = metadata[BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID]
- blueprintModel.artifactType = ApplicationConstants.ASDC_ARTIFACT_TYPE_SDNC_MODEL
- blueprintModel.published = metadata[BluePrintConstants.PROPERTY_BLUEPRINT_VALID]
- ?: BluePrintConstants.FLAG_N
- blueprintModel.artifactName = artifactName
- blueprintModel.artifactVersion = artifactVersion
- blueprintModel.updatedBy = metadata[BluePrintConstants.METADATA_TEMPLATE_AUTHOR]!!
- blueprintModel.tags = metadata[BluePrintConstants.METADATA_TEMPLATE_TAGS]!!
- blueprintModel.artifactDescription = "Controller Blueprint for $artifactName:$artifactVersion"
-
- val blueprintModelContent = BlueprintModelContent()
- blueprintModelContent.id = metadata[BluePrintConstants.PROPERTY_BLUEPRINT_PROCESS_ID]
- blueprintModelContent.contentType = "CBA_ZIP"
- blueprintModelContent.name = "$artifactName:$artifactVersion"
- blueprintModelContent.description = "$artifactName:$artifactVersion CBA Zip Content"
- blueprintModelContent.content = Files.readAllBytes(archiveFile.toPath())
- blueprintModelContent.blueprintModel = blueprintModel
- // Set the Blueprint Model Content into blueprintModel
- blueprintModel.blueprintModelContent = blueprintModelContent
-
- try {
- blueprintModelRepository.saveAndFlush(blueprintModel)
- } catch (ex: DataIntegrityViolationException) {
- throw BluePrintException(ErrorCode.CONFLICT_ADDING_RESOURCE.value, "The blueprint entry " +
- "is already exist in database: ${ex.message}", ex)
- }
- }
-} \ No newline at end of file
diff --git a/ms/controllerblueprints/modules/blueprint-proto/pom.xml b/ms/controllerblueprints/modules/blueprint-proto/pom.xml
index 91097b9d9..fef6cb7ac 100644
--- a/ms/controllerblueprints/modules/blueprint-proto/pom.xml
+++ b/ms/controllerblueprints/modules/blueprint-proto/pom.xml
@@ -14,7 +14,6 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
diff --git a/ms/py-executor/pom.xml b/ms/py-executor/pom.xml
index ef528989b..9ede1b21b 100644
--- a/ms/py-executor/pom.xml
+++ b/ms/py-executor/pom.xml
@@ -14,7 +14,6 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
diff --git a/pom.xml b/pom.xml
index a86d744fb..6d0f6789e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.0</version>
<relativePath/>
</parent>