aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/inbounds/designer-api
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/modules/inbounds/designer-api')
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandler.kt22
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt6
2 files changed, 22 insertions, 6 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))
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt
index 691cfd760..54dd46ef7 100644
--- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt
@@ -183,8 +183,10 @@ class BluePrintManagementGRPCHandlerTest {
return BluePrintRemoveInput.newBuilder()
.setCommonHeader(commonHeader)
- .setBlueprintName("sample")
- .setBlueprintVersion("1.0.0")
+ .setActionIdentifiers(ActionIdentifiers.newBuilder()
+ .setBlueprintName("sample")
+ .setBlueprintVersion("1.0.0")
+ .setActionName(RemoveAction.DEFAULT.toString()).build())
.build()
}
}