syntax = "proto3"; package sciobjsdb.api.storage.services.v1; option go_package = "github.com/ScienceObjectsDB/go-api/sciobjsdb/api/storage/services/v1"; option java_multiple_files = true; option java_package = "com.github.ScienceObjectsDB.java_api.sciobjsdb.api.storage.services.v1"; option java_outer_classname = "ObjectLoadServices"; import "sciobjsdb/api/storage/services/v1/object_load_models.proto"; import "google/api/annotations.proto"; // Handles object up and downloads service ObjectLoadService { // Creates an upload link for an object to upload the actual data object // Returns a presigned https PUT request // Can only be used to upload objects < 4GB rpc CreateUploadLink(CreateUploadLinkRequest) returns (CreateUploadLinkResponse) { option (google.api.http) = { get: "/api/v1/objectload/upload/{id}" }; } // Creates a download link for an object // Returns a presigned https GET request rpc CreateDownloadLink(CreateDownloadLinkRequest) returns (CreateDownloadLinkResponse) { option (google.api.http) = { get: "/api/v1/objectload/download/{id}" }; } // Creates links for multiple objects at once // The order of the requested objects is preserved in the response rpc CreateDownloadLinkBatch(CreateDownloadLinkBatchRequest) returns (CreateDownloadLinkBatchResponse) { option (google.api.http) = { post: "/api/v1/objectload/download_batch" body: "*" }; } // Creates a stream of objects and presigned links based on the provided query // This can be used retrieve a large number of ObjectGroups as a stream that would otherwise cause issues with the connection rpc CreateDownloadLinkStream(CreateDownloadLinkStreamRequest) returns (stream CreateDownloadLinkStreamResponse) { option (google.api.http) = { post: "/api/v1/objectload/download_batch_stream" body: "*" }; } // Initiates a multipart upload for an object // This is intended to be used for larger objects // For further information please read the Amazon S3 documentation on multipart uploads // Has to be used together with GetMultipartUploadLink and CompleteMultipartUpload rpc StartMultipartUpload(StartMultipartUploadRequest) returns (StartMultipartUploadResponse) { option (google.api.http) = { post: "/api/v1/objectload/init_multipart/{id}" }; } // Returns a part of an multipart upload. // Each but the last part needs to be bigger than 5MB in order to use this functionality rpc GetMultipartUploadLink(GetMultipartUploadLinkRequest) returns (GetMultipartUploadLinkResponse) { option (google.api.http) = { get: "/api/v1/objectload/upload_multipart_part/{object_id}/{upload_part}" }; } //CompleteMultipartUploadRequest Finishes a multipart upload after all parts have been uploaded rpc CompleteMultipartUpload(CompleteMultipartUploadRequest) returns (CompleteMultipartUploadResponse) { option (google.api.http) = { post: "/api/v1/objectload/complete_multipart" body: "*" }; } }