From 0440b8f6fa6027e661224ca9be6e7d542805d522 Mon Sep 17 00:00:00 2001 From: Ben Yip Date: Fri, 5 Jan 2024 17:22:17 +0100 Subject: [PATCH] CORE-15805: Avro for getting schema SQL (#1389) * Added VirtualNodeSchemaRequest and Response and add to VirtualNodeManagement avro class --- .../VirtualNodeManagementRequest.avsc | 3 +- .../VirtualNodeManagementResponse.avsc | 3 +- .../virtualnode/VirtualNodeSchemaRequest.avsc | 31 +++++++++++++++++++ .../VirtualNodeSchemaResponse.avsc | 11 +++++++ 4 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeSchemaRequest.avsc create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeSchemaResponse.avsc diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeManagementRequest.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeManagementRequest.avsc index 910557e7a4..0deed8eae7 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeManagementRequest.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeManagementRequest.avsc @@ -18,7 +18,8 @@ "type": [ "net.corda.data.virtualnode.VirtualNodeStateChangeRequest", "net.corda.data.virtualnode.VirtualNodeDBResetRequest", - "net.corda.data.virtualnode.VirtualNodeOperationStatusRequest" + "net.corda.data.virtualnode.VirtualNodeOperationStatusRequest", + "net.corda.data.virtualnode.VirtualNodeSchemaRequest" ] } ] diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeManagementResponse.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeManagementResponse.avsc index 157aa96379..2a4da7abac 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeManagementResponse.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeManagementResponse.avsc @@ -21,7 +21,8 @@ "net.corda.data.virtualnode.VirtualNodeUpdateDbStatusResponse", "net.corda.data.virtualnode.VirtualNodeDBResetResponse", "net.corda.data.virtualnode.VirtualNodeManagementResponseFailure", - "net.corda.data.virtualnode.VirtualNodeOperationStatusResponse" + "net.corda.data.virtualnode.VirtualNodeOperationStatusResponse", + "net.corda.data.virtualnode.VirtualNodeSchemaResponse" ] } ] diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeSchemaRequest.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeSchemaRequest.avsc new file mode 100644 index 0000000000..3979e29e6e --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeSchemaRequest.avsc @@ -0,0 +1,31 @@ +{ + "type": "record", + "name": "VirtualNodeSchemaRequest", + "namespace": "net.corda.data.virtualnode", + "doc": "Represents the input parameters for getting a schema SQL", + "fields": [ + { + "name": "dbType", + "doc": "The type of database to get the schema from.", + "type": { + "name": "DbTypes", + "type": "enum", + "symbols": [ + "CRYPTO", + "UNIQUENESS", + "VAULT" + ] + } + }, + { + "name": "virtualNodeShortHash", + "type": [ "null", "string" ], + "doc": "Short hash of the virtual node." + }, + { + "name": "cpiChecksum", + "type": [ "null", "string" ], + "doc": "The checksum of the CPI file." + } + ] +} \ No newline at end of file diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeSchemaResponse.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeSchemaResponse.avsc new file mode 100644 index 0000000000..f506530f6a --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/virtualnode/VirtualNodeSchemaResponse.avsc @@ -0,0 +1,11 @@ +{ + "type": "record", + "name": "VirtualNodeSchemaResponse", + "namespace": "net.corda.data.virtualnode", + "fields": [ + { + "name": "schemaSql", + "type": "string" + } + ] +} \ No newline at end of file