From 9c34e2ec9f3912daddd07dcf665bef19aaaeb572 Mon Sep 17 00:00:00 2001 From: Peter Krull Date: Fri, 13 Dec 2024 16:18:04 -0700 Subject: [PATCH 1/2] Add simulation logs rpc --- ansys/api/additive/VERSION | 2 +- ansys/api/additive/v0/about.proto | 20 ---------------- ansys/api/additive/v0/additive_domain.proto | 12 ++++++++++ .../additive/v0/additive_server_info.proto | 24 +++++++++++++++++++ .../api/additive/v0/additive_simulation.proto | 16 +++---------- 5 files changed, 40 insertions(+), 34 deletions(-) delete mode 100644 ansys/api/additive/v0/about.proto create mode 100644 ansys/api/additive/v0/additive_server_info.proto diff --git a/ansys/api/additive/VERSION b/ansys/api/additive/VERSION index 6cec60f..953e3b9 100644 --- a/ansys/api/additive/VERSION +++ b/ansys/api/additive/VERSION @@ -1 +1 @@ -2.2.2-dev0 +3.0.0-dev0 diff --git a/ansys/api/additive/v0/about.proto b/ansys/api/additive/v0/about.proto deleted file mode 100644 index 5757ea7..0000000 --- a/ansys/api/additive/v0/about.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; - -package ansys.api.additive.v0.about; - -option csharp_namespace = "Ansys.Api.Additive"; -import "google/api/annotations.proto"; -import "google/protobuf/empty.proto"; - - -service AboutService { - rpc About (google.protobuf.Empty) returns (AboutResponse) { - option (google.api.http) = { - get: "/about" - }; - } -} - -message AboutResponse { - map metadata = 1; -} \ No newline at end of file diff --git a/ansys/api/additive/v0/additive_domain.proto b/ansys/api/additive/v0/additive_domain.proto index 895c329..a87fc3b 100644 --- a/ansys/api/additive/v0/additive_domain.proto +++ b/ansys/api/additive/v0/additive_domain.proto @@ -289,4 +289,16 @@ message Microstructure3DInput { message Microstructure3DResult { bytes three_d_vtk = 1; MicrostructureResult two_d_result = 2; +} + +// DownloadFileResponse is used to transfer a file in chunks from +// the server to a client. Content and content_md5 may be empty +// if only a progress message is sent. It is defined here because +// it is used in multiple services. +message DownloadFileResponse { + string file_name = 1; // name of file without path + uint64 total_size = 2; // total file size in bytes + bytes content = 3; // chunk of file content + string content_md5 = 4; // md5 hash of content + Progress progress = 10; // download progress } \ No newline at end of file diff --git a/ansys/api/additive/v0/additive_server_info.proto b/ansys/api/additive/v0/additive_server_info.proto new file mode 100644 index 0000000..38208c6 --- /dev/null +++ b/ansys/api/additive/v0/additive_server_info.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package ansys.api.additive.v0.about; + +option csharp_namespace = "Ansys.Api.Additive"; +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "ansys/api/additive/v0/additive_domain.proto"; + +service ServerInfoService { + rpc About (google.protobuf.Empty) returns (AboutResponse) { + option (google.api.http) = { + get: "/about" + }; + } + + rpc DownloadLogs(google.protobuf.Empty) returns (stream DownloadFileResponse); +} + +message AboutResponse { + map metadata = 1; +} + + diff --git a/ansys/api/additive/v0/additive_simulation.proto b/ansys/api/additive/v0/additive_simulation.proto index ce01864..e04e5bc 100644 --- a/ansys/api/additive/v0/additive_simulation.proto +++ b/ansys/api/additive/v0/additive_simulation.proto @@ -20,7 +20,7 @@ service SimulationService { rpc DownloadFile(DownloadFileRequest) returns (stream DownloadFileResponse); - rpc DownloadLogs(DownloadLogsRequest) returns (stream DownloadFileResponse); + rpc SimulationLogs(SimulationLogsRequest) returns (stream DownloadFileResponse); rpc Mesh(MeshRequest) returns (google.longrunning.Operation) { option (google.longrunning.operation_info) = { @@ -74,18 +74,8 @@ message DownloadFileRequest { string remote_file_name = 1; // full path to file on server } -message DownloadLogsRequest { -} - -// DownloadFileResponse is used to transfer a file in chunks from -// the server to a client. Content and content_md5 may be empty -// if only a progress message is sent. -message DownloadFileResponse { - string file_name = 1; // name of file without path - uint64 total_size = 2; // total file size in bytes - bytes content = 3; // chunk of file content - string content_md5 = 4; // md5 hash of content - Progress progress = 10; // download progress +message SimulationLogsRequest { + string id = 1; // id of the simulation } message MeshRequest { From b9fcb42f6921e0344652ad3b105d604dc102e5c6 Mon Sep 17 00:00:00 2001 From: Peter Krull Date: Fri, 13 Dec 2024 16:20:59 -0700 Subject: [PATCH 2/2] Rename DownloadLogs endpoint --- ansys/api/additive/v0/additive_server_info.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansys/api/additive/v0/additive_server_info.proto b/ansys/api/additive/v0/additive_server_info.proto index 38208c6..7fd911a 100644 --- a/ansys/api/additive/v0/additive_server_info.proto +++ b/ansys/api/additive/v0/additive_server_info.proto @@ -14,7 +14,7 @@ service ServerInfoService { }; } - rpc DownloadLogs(google.protobuf.Empty) returns (stream DownloadFileResponse); + rpc ServerLogs(google.protobuf.Empty) returns (stream DownloadFileResponse); } message AboutResponse {