aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin
diff options
context:
space:
mode:
authorBrinda Santh <brindasanth@in.ibm.com>2019-09-17 15:56:20 -0400
committerBrinda Santh <brindasanth@in.ibm.com>2019-09-17 15:56:20 -0400
commit5ef6d930f1ade3a80a983762bd7c7b0ecc96cde9 (patch)
treee4e64c20c32a923b5f310eec8176e7063d2c0cef /ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin
parent24f39fda67bec6f622c25effcd2a1626efae772a (diff)
Add cba GRPC remove options.
Change-Id: Iaba18e145f11fc608f5b6efa8bdfb46c623d7ccf Issue-ID: CCSDK-1682 Signed-off-by: Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin')
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandler.kt22
1 files changed, 18 insertions, 4 deletions
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandler.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandler.kt
index a3bf3709d..0f804b8b2 100644
--- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandler.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandler.kt
@@ -129,14 +129,28 @@ open class BluePrintManagementGRPCHandler(private val bluePrintModelHandler: Blu
StreamObserver<BluePrintManagementOutput>) {
runBlocking {
- val blueprintName = request.blueprintName
- val blueprintVersion = request.blueprintVersion
+ val blueprintName = request.actionIdentifiers.blueprintName
+ val blueprintVersion = request.actionIdentifiers.blueprintVersion
val blueprint = "blueprint $blueprintName:$blueprintVersion"
log.info("request(${request.commonHeader.requestId}): Received delete $blueprint")
+
+ /** Get the Remove Action */
+ val removeAction = request.actionIdentifiers?.actionName.emptyTONull()
+ ?: RemoveAction.DEFAULT.toString()
+
try {
- bluePrintModelHandler.deleteBlueprintModel(blueprintName, blueprintVersion)
- responseObserver.onNext(successStatus(request.commonHeader))
+ when (removeAction) {
+ RemoveAction.DEFAULT.toString() -> {
+ bluePrintModelHandler.deleteBlueprintModel(blueprintName, blueprintVersion)
+ responseObserver.onNext(successStatus(request.commonHeader))
+ }
+ else -> {
+ responseObserver.onNext(failStatus(request.commonHeader,
+ "Remove action($removeAction) not implemented",
+ BluePrintProcessorException("Not implemented")))
+ }
+ }
} catch (e: Exception) {
responseObserver.onNext(failStatus(request.commonHeader,
"request(${request.commonHeader.requestId}): Failed to delete $blueprint", e))