Skip to content
Snippets Groups Projects
Commit 014805af authored by Joscha Schmiedt's avatar Joscha Schmiedt
Browse files

feat: extend file transmission API to support file upload via TUS

parent 116f3dda
No related branches found
No related tags found
1 merge request!12Extend Upload API for resumable downloads
Pipeline #61577 failed
......@@ -24,6 +24,7 @@ option java_multiple_files = true;
option java_package = "org.caosdb.api.entity.v2";
option cc_enable_arenas = true;
package caosdb.entity.v2;
import "caosdb/file_transmission/v1/main.proto"; // for FileTransmissionId
// Data type for references to other entities.
message ReferenceDataType {
......
......@@ -82,8 +82,55 @@ enum TransmissionStatus {
TRANSMISSION_STATUS_GO_ON = 3;
}
// Register a file upload.
message RegisterFileUploadRequest {}
// TODO: This is very similar to the Hash message in the entity API. We should discuss
// if and how they can be merged.
enum ChecksumAlgorithm {
CHECKSUM_ALGORITHM_UNSPECIFIED = 0;
CHECKSUM_ALGORITHM_MD5 = 1;
CHECKSUM_ALGORITHM_SHA1 = 2;
CHECKSUM_ALGORITHM_SHA256 = 3;
CHECKSUM_ALGORITHM_SHA512 = 4;
}
message Checksum {
string checksum = 1;
ChecksumAlgorithm checksum_algorithm = 2;
}
// Information about a file which is to be uploaded.
// TODO: This is very similar to the FileDescriptor message in the entity API with the
// difference that it has no relation to an entity and is purely filesystem-oriented.
// Maybe we should re-use FileInformation s part of the entity API?
message FileInformation {
// The local filename is the filename, which is used on the client.
string local_filename = 1;
// The target filename is the filename which will be used on the server.
string target_filename = 2;
// Size of the file in bytes.
int size_bytes = 3;
// Checksum of the file according to the checksum algorithm.
Checksum checksum = 4;
}
// Register a file upload for a list of files. The server will respond with a
// registration id and URLs to which the files can be uploaded.
message RegisterFileUploadRequest {
repeated FileInformation = 1;
}
// The URL to which a file should be uploaded using the given LinkAhead
// UploadProtocolVersion.
message UploadLocation {
string url = 1;
}
// The version of the LinkAhead upload protocol. This is currently identical to
// the TUS protocol version.
message UploadProtocolVersion {
int major = 1;
int minor = 2;
int patch = 3;
}
// Response of the file server upon an upload registration request.
message RegisterFileUploadResponse {
......@@ -94,6 +141,8 @@ message RegisterFileUploadResponse {
string registration_id = 2;
// The server's transmission settings for the upload.
FileTransmissionSettings upload_settings = 4;
UploadProtocolVersion version = 5;
repeated UploadLocation locations = 6;
}
// Request for a file upload which has been registered previously. Chunks may be
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment