Skip to content

Commit 864cfac

Browse files
authored
Refactor upload and download messages (#8)
* Refactor upload and download messages * Fix typo * Bump version * Add comment
1 parent 94a4147 commit 864cfac

File tree

2 files changed

+17
-24
lines changed

2 files changed

+17
-24
lines changed

ansys/api/additive/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.2
1+
1.0.3

ansys/api/additive/v0/additive_simulation.proto

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,14 @@ message SimulationRequest {
3636
}
3737
}
3838

39-
// FileUploadRequst is used to transfer a file in chunks from
40-
// a client to the server. Each message should be less than
41-
// 4 MB unless the gRPC max message size has been changed.
42-
// Following the transfer of the file contents, a final message
43-
// must be sent which includes the md5 sum of the entire file.
39+
// FileUploadRequest is used to transfer a file in chunks from
40+
// a client to the server. Each message should be <= 4MiB
41+
// unless the gRPC max receive message size has been changed.
4442
message FileUploadRequest {
45-
string name = 1;
46-
uint64 total_size = 2;
47-
oneof Data {
48-
bytes content = 3;
49-
string md5 = 4; // sent when transfer is complete
50-
}
43+
string name = 1; // file name on client
44+
uint64 total_size = 2; // total file size in bytes
45+
bytes content = 3; // chunk of file content
46+
string content_md5 = 4; // md5 hash of content
5147
}
5248

5349
message FileUploadResponse {
@@ -56,19 +52,16 @@ message FileUploadResponse {
5652
}
5753

5854
message FileDownloadRequest {
59-
string remote_file_name = 1;
55+
string remote_file_name = 1; // full path to file on server
6056
}
6157

62-
// FileDownloadRequst is used to transfer a file in chunks from
63-
// the server to a client. Each message should be less than
64-
// 4 MB unless the gRPC max message size has been changed.
65-
// Following the transfer of the file contents, a final message
66-
// must be sent which includes the md5 sum of the entire file.
58+
// FileDownloadResponse is used to transfer a file in chunks from
59+
// the server to a client. Content and content_md5 may be empty
60+
// if only a progress message is sent.
6761
message FileDownloadResponse {
68-
string file_name = 1;
69-
uint64 total_size = 2;
70-
oneof Data {
71-
bytes content = 3;
72-
string md5 = 4; // sent when transfer is complete
73-
}
62+
string file_name = 1; // name of file without path
63+
uint64 total_size = 2; // total file size in bytes
64+
bytes content = 3; // chunk of file content
65+
string content_md5 = 4; // md5 hash of content
66+
Progress progress = 10; // download progress
7467
}

0 commit comments

Comments
 (0)