[#37] Add body message to object requests

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-08-11 11:59:36 +03:00 committed by Stanislav Bogatyrev
parent 7447bdceee
commit 60690a0f0b

View file

@ -5,8 +5,8 @@ package object;
option go_package = "github.com/nspcc-dev/neofs-api-go/object";
option csharp_namespace = "NeoFS.API.Object";
import "refs/types.proto";
import "object/types.proto";
import "refs/types.proto";
import "service/meta.proto";
import "service/verify.proto";
@ -53,6 +53,7 @@ service Service {
}
message GetRequest {
message Body {
// Carries the address of the requested object.
refs.Address address = 1;
@ -60,17 +61,22 @@ message GetRequest {
// Raw request is sent to receive only the objects
// that are physically stored on the server.
bool raw = 2;
}
// Body of get object request message.
Body body = 1;
// Carries request meta information. Header data is used only to regulate message
// transport and does not affect request execution.
service.RequestMetaHeader meta_header = 98;
service.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to authenticate
// the nodes of the message route and check the correctness of transmission.
service.RequestVerificationHeader verify_header = 99;
service.RequestVerificationHeader verify_header = 3;
}
message GetResponse {
message Body {
// Carries the single message of the response stream.
oneof ObjectPart {
// Carries the object header.
@ -79,9 +85,23 @@ message GetResponse {
// Carries part of the object payload.
bytes chunk = 2;
}
}
// Body of get object response message.
Body body = 1;
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.ResponseVerificationHeader verify_header = 3;
}
message PutRequest {
message Body {
// Groups initialization parameters of object placement in NeoFS.
message Init {
// Carries the header of the object to save in the system.
@ -101,44 +121,81 @@ message PutRequest {
// Carries part of the object payload.
bytes chunk = 2;
}
}
// Body of put object request message.
Body body = 1;
// Carries request meta information. Header data is used only to regulate message
// transport and does not affect request execution.
service.RequestMetaHeader meta_header = 98;
service.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to authenticate
// the nodes of the message route and check the correctness of transmission.
service.RequestVerificationHeader verify_header = 99;
service.RequestVerificationHeader verify_header = 3;
}
message PutResponse {
message Body {
// Carries identifier of the saved object.
// It is used to access an object in the container.
refs.ObjectID object_id = 1;
}
// Body of put object response message.
Body body = 1;
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.ResponseVerificationHeader verify_header = 3;
}
message DeleteRequest {
message Body {
// Carries the address of the object to be deleted.
refs.Address address = 1;
// Carries identifier the object owner.
refs.OwnerID owner_id = 2;
}
// Body of delete object request message.
Body body = 1;
// Carries request meta information. Header data is used only to regulate message
// transport and does not affect request execution.
service.RequestMetaHeader meta_header = 98;
service.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to authenticate
// the nodes of the message route and check the correctness of transmission.
service.RequestVerificationHeader verify_header = 99;
service.RequestVerificationHeader verify_header = 3;
}
// DeleteResponse is empty because we cannot guarantee permanent object removal
// in distributed system.
message DeleteResponse {
message Body { }
// Body of delete object response message.
Body body = 1;
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.ResponseVerificationHeader verify_header = 3;
}
message HeadRequest {
message Body {
// Carries the address of the object with the requested header.
refs.Address address = 1;
@ -149,22 +206,41 @@ message HeadRequest {
// Raw request is sent to receive only the headers of the objects
// that are physically stored on the server.
bool raw = 3;
}
// Body of head object request message.
Body body = 1;
// Carries request meta information. Header data is used only to regulate message
// transport and does not affect request execution.
service.RequestMetaHeader meta_header = 98;
service.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to authenticate
// the nodes of the message route and check the correctness of transmission.
service.RequestVerificationHeader verify_header = 99;
service.RequestVerificationHeader verify_header = 3;
}
message HeadResponse {
message Body {
// Carries the requested object header.
Header header = 1;
}
// Body of head object response message.
Body body = 1;
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.ResponseVerificationHeader verify_header = 3;
}
message SearchRequest {
message Body {
// Carries search container identifier.
refs.ContainerID container_id = 1;
@ -188,19 +264,37 @@ message SearchRequest {
}
Query query = 2;
}
// Body of search object request message.
Body body = 1;
// Carries request meta information. Header data is used only to regulate message
// transport and does not affect request execution.
service.RequestMetaHeader meta_header = 98;
service.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to authenticate
// the nodes of the message route and check the correctness of transmission.
service.RequestVerificationHeader verify_header = 99;
service.RequestVerificationHeader verify_header = 3;
}
message SearchResponse {
message Body {
// Carries list of object identifiers that match the search query.
repeated refs.ObjectID id_list = 1;
}
// Body of search object response message.
Body body = 1;
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.ResponseVerificationHeader verify_header = 3;
}
// Range groups the parameters of object payload range.
@ -213,27 +307,47 @@ message Range {
}
message GetRangeRequest {
message Body {
// Address carries address of the object that contains the requested payload range.
refs.Address address = 1;
// Range carries the parameters of the requested payload range.
Range range = 2;
}
// Body of get range object request message.
Body body = 1;
// Carries request meta information. Header data is used only to regulate message
// transport and does not affect request execution.
service.RequestMetaHeader meta_header = 98;
service.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to authenticate
// the nodes of the message route and check the correctness of transmission.
service.RequestVerificationHeader verify_header = 99;
service.RequestVerificationHeader verify_header = 3;
}
message GetRangeResponse {
message Body {
// Carries part of the object payload.
bytes chunk = 1;
}
// Body of get range object response message.
Body body = 1;
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.ResponseVerificationHeader verify_header = 3;
}
message GetRangeHashRequest {
message Body {
// Carries address of the object that contains the requested payload range.
refs.Address address = 1;
@ -242,18 +356,36 @@ message GetRangeHashRequest {
// Carries binary salt to XOR object payload ranges before hash calculation.
bytes salt = 3;
}
// Body of get range hash object request message.
Body body = 1;
// Carries request meta information. Header data is used only to regulate message
// transport and does not affect request execution.
service.RequestMetaHeader meta_header = 98;
service.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to authenticate
// the nodes of the message route and check the correctness of transmission.
service.RequestVerificationHeader verify_header = 99;
service.RequestVerificationHeader verify_header = 3;
}
message GetRangeHashResponse {
message Body {
// Carries list of homomorphic hashes in a binary format.
repeated bytes hash_list = 1;
}
// Body of get range hash object response message.
Body body = 1;
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.ResponseVerificationHeader verify_header = 3;
}