Change-Id: Iaba18e145f11fc608f5b6efa8bdfb46c623d7ccf
Issue-ID: CCSDK-1682
Signed-off-by: Brinda Santh <brindasanth@in.ibm.com>
message BluePrintRemoveInput {
org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader commonHeader = 1;
message BluePrintRemoveInput {
org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader commonHeader = 1;
- string blueprintName = 2;
- string blueprintVersion = 3;
+ org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers actionIdentifiers = 2;
+ // Extra optional dynamic properties used to remove.
+ google.protobuf.Struct properties = 3;
}
message BluePrintManagementOutput {
}
message BluePrintManagementOutput {
+enum RemoveAction {
+ // Delete CBA from database, deploy path and clean cache.
+ DEFAULT = 0;
+}
+
service BluePrintManagementService {
rpc downloadBlueprint (BluePrintDownloadInput) returns (BluePrintManagementOutput);
rpc uploadBlueprint (BluePrintUploadInput) returns (BluePrintManagementOutput);
service BluePrintManagementService {
rpc downloadBlueprint (BluePrintDownloadInput) returns (BluePrintManagementOutput);
rpc uploadBlueprint (BluePrintUploadInput) returns (BluePrintManagementOutput);
StreamObserver<BluePrintManagementOutput>) {
runBlocking {
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")
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()
+
- 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))
} catch (e: Exception) {
responseObserver.onNext(failStatus(request.commonHeader,
"request(${request.commonHeader.requestId}): Failed to delete $blueprint", e))
return BluePrintRemoveInput.newBuilder()
.setCommonHeader(commonHeader)
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())