summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules
diff options
context:
space:
mode:
authorBrinda Santh Muthuramalingam <brindasanth@in.ibm.com>2019-12-30 14:42:59 +0000
committerGerrit Code Review <gerrit@onap.org>2019-12-30 14:42:59 +0000
commit86c2b15ff80c824806c0947299f2cb9576b8f396 (patch)
tree2c25903c7d7e52fd2c6857f8385f1ba08a6cb1b1 /ms/blueprintsprocessor/modules
parentc66d0094f624dcf97e08a5fc9a2a5e01c90bb772 (diff)
parent11a93717a4292c30c71de950fb39637f9c8efd17 (diff)
Merge "add package creation component and fixing designer compilation and linting"
Diffstat (limited to 'ms/blueprintsprocessor/modules')
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt9
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt6
2 files changed, 10 insertions, 5 deletions
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt
index f257157c8..0eb29f4cc 100644
--- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt
@@ -30,6 +30,7 @@ import org.springframework.core.io.Resource
import org.springframework.data.domain.Page
import org.springframework.data.domain.PageRequest
import org.springframework.data.domain.Sort
+import org.springframework.http.HttpStatus
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity
import org.springframework.http.codec.multipart.FilePart
@@ -129,8 +130,12 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint
@PathVariable(value = "name") name: String,
@PathVariable(value = "version") version: String
):
- Mono<BlueprintModelSearch> = monoMdc {
- bluePrintModelHandler.getBlueprintModelSearchByNameAndVersion(name, version)
+ Mono<ResponseEntity<BlueprintModelSearch>> = monoMdc {
+ var bluePrintModel: BlueprintModelSearch? = bluePrintModelHandler.getBlueprintModelSearchByNameAndVersion(name, version)
+ if (bluePrintModel != null)
+ ResponseEntity(bluePrintModel, HttpStatus.OK)
+ else
+ ResponseEntity(HttpStatus.NO_CONTENT)
}
@GetMapping("/download/by-name/{name}/version/{version}", produces = [MediaType.APPLICATION_JSON_VALUE])
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt
index 392fa0bb4..274650ae4 100644
--- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt
@@ -145,12 +145,12 @@ open class BluePrintModelHandler(
* @throws BluePrintException BluePrintException
*/
@Throws(BluePrintException::class)
- open fun getBlueprintModelSearchByNameAndVersion(name: String, version: String): BlueprintModelSearch {
+ open fun getBlueprintModelSearchByNameAndVersion(name: String, version: String): BlueprintModelSearch? {
return blueprintModelSearchRepository.findByArtifactNameAndArtifactVersion(name, version)
- ?: throw BluePrintException(
+ /*?: throw BluePrintException(
ErrorCode.RESOURCE_NOT_FOUND.value,
String.format(BLUEPRINT_MODEL_NAME_VERSION_FAILURE_MSG, name, version)
- )
+ )*/
}
/**