forked from TrueCloudLab/frostfs-api
[#37] Add body message to object requests
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
7447bdceee
commit
60690a0f0b
1 changed files with 223 additions and 91 deletions
|
@ -5,8 +5,8 @@ package object;
|
||||||
option go_package = "github.com/nspcc-dev/neofs-api-go/object";
|
option go_package = "github.com/nspcc-dev/neofs-api-go/object";
|
||||||
option csharp_namespace = "NeoFS.API.Object";
|
option csharp_namespace = "NeoFS.API.Object";
|
||||||
|
|
||||||
import "refs/types.proto";
|
|
||||||
import "object/types.proto";
|
import "object/types.proto";
|
||||||
|
import "refs/types.proto";
|
||||||
import "service/meta.proto";
|
import "service/meta.proto";
|
||||||
import "service/verify.proto";
|
import "service/verify.proto";
|
||||||
|
|
||||||
|
@ -53,154 +53,248 @@ service Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetRequest {
|
message GetRequest {
|
||||||
// Carries the address of the requested object.
|
message Body {
|
||||||
refs.Address address = 1;
|
// Carries the address of the requested object.
|
||||||
|
refs.Address address = 1;
|
||||||
|
|
||||||
// Carries the raw option flag of the request.
|
// Carries the raw option flag of the request.
|
||||||
// Raw request is sent to receive only the objects
|
// Raw request is sent to receive only the objects
|
||||||
// that are physically stored on the server.
|
// that are physically stored on the server.
|
||||||
bool raw = 2;
|
bool raw = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Body of get object request message.
|
||||||
|
Body body = 1;
|
||||||
|
|
||||||
// Carries request meta information. Header data is used only to regulate message
|
// Carries request meta information. Header data is used only to regulate message
|
||||||
// transport and does not affect request execution.
|
// 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
|
// Carries request verification information. This header is used to authenticate
|
||||||
// the nodes of the message route and check the correctness of transmission.
|
// 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 GetResponse {
|
||||||
// Carries the single message of the response stream.
|
message Body {
|
||||||
oneof ObjectPart {
|
// Carries the single message of the response stream.
|
||||||
// Carries the object header.
|
oneof ObjectPart {
|
||||||
Header header = 1;
|
// Carries the object header.
|
||||||
|
Header header = 1;
|
||||||
|
|
||||||
// Carries part of the object payload.
|
// Carries part of the object payload.
|
||||||
bytes chunk = 2;
|
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 PutRequest {
|
||||||
// Groups initialization parameters of object placement in NeoFS.
|
message Body {
|
||||||
message Init {
|
// Groups initialization parameters of object placement in NeoFS.
|
||||||
// Carries the header of the object to save in the system.
|
message Init {
|
||||||
Header header = 1;
|
// Carries the header of the object to save in the system.
|
||||||
|
Header header = 1;
|
||||||
|
|
||||||
// Carries the number of the object copies to store
|
// Carries the number of the object copies to store
|
||||||
// within the RPC call. Default zero value is processed according
|
// within the RPC call. Default zero value is processed according
|
||||||
// to the container placement rules.
|
// to the container placement rules.
|
||||||
uint32 copies_number = 2;
|
uint32 copies_number = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Carries the single part of the query stream.
|
||||||
|
oneof Part {
|
||||||
|
// Carries the initialization parameters of the object stream.
|
||||||
|
Init init = 1;
|
||||||
|
|
||||||
|
// Carries part of the object payload.
|
||||||
|
bytes chunk = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Carries the single part of the query stream.
|
// Body of put object request message.
|
||||||
oneof Part {
|
Body body = 1;
|
||||||
// Carries the initialization parameters of the object stream.
|
|
||||||
Init init = 1;
|
|
||||||
|
|
||||||
// Carries part of the object payload.
|
|
||||||
bytes chunk = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Carries request meta information. Header data is used only to regulate message
|
// Carries request meta information. Header data is used only to regulate message
|
||||||
// transport and does not affect request execution.
|
// 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
|
// Carries request verification information. This header is used to authenticate
|
||||||
// the nodes of the message route and check the correctness of transmission.
|
// 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 PutResponse {
|
||||||
// Carries identifier of the saved object.
|
message Body {
|
||||||
// It is used to access an object in the container.
|
// Carries identifier of the saved object.
|
||||||
refs.ObjectID object_id = 1;
|
// 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 DeleteRequest {
|
||||||
// Carries the address of the object to be deleted.
|
message Body {
|
||||||
refs.Address address = 1;
|
// Carries the address of the object to be deleted.
|
||||||
|
refs.Address address = 1;
|
||||||
|
|
||||||
// Carries identifier the object owner.
|
// Carries identifier the object owner.
|
||||||
refs.OwnerID owner_id = 2;
|
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
|
// Carries request meta information. Header data is used only to regulate message
|
||||||
// transport and does not affect request execution.
|
// 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
|
// Carries request verification information. This header is used to authenticate
|
||||||
// the nodes of the message route and check the correctness of transmission.
|
// 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
|
// DeleteResponse is empty because we cannot guarantee permanent object removal
|
||||||
// in distributed system.
|
// in distributed system.
|
||||||
message DeleteResponse {
|
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 HeadRequest {
|
||||||
// Carries the address of the object with the requested header.
|
message Body {
|
||||||
refs.Address address = 1;
|
// Carries the address of the object with the requested header.
|
||||||
|
refs.Address address = 1;
|
||||||
|
|
||||||
// Carries the option to crop header to main part.
|
// Carries the option to crop header to main part.
|
||||||
bool main_only = 2;
|
bool main_only = 2;
|
||||||
|
|
||||||
// Carries the raw option flag of the request.
|
// Carries the raw option flag of the request.
|
||||||
// Raw request is sent to receive only the headers of the objects
|
// Raw request is sent to receive only the headers of the objects
|
||||||
// that are physically stored on the server.
|
// that are physically stored on the server.
|
||||||
bool raw = 3;
|
bool raw = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Body of head object request message.
|
||||||
|
Body body = 1;
|
||||||
|
|
||||||
// Carries request meta information. Header data is used only to regulate message
|
// Carries request meta information. Header data is used only to regulate message
|
||||||
// transport and does not affect request execution.
|
// 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
|
// Carries request verification information. This header is used to authenticate
|
||||||
// the nodes of the message route and check the correctness of transmission.
|
// 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 HeadResponse {
|
||||||
// Carries the requested object header.
|
message Body {
|
||||||
Header header = 1;
|
// 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 SearchRequest {
|
||||||
// Carries search container identifier.
|
message Body {
|
||||||
refs.ContainerID container_id = 1;
|
// Carries search container identifier.
|
||||||
|
refs.ContainerID container_id = 1;
|
||||||
|
|
||||||
message Query {
|
message Query {
|
||||||
uint32 version = 1;
|
uint32 version = 1;
|
||||||
|
|
||||||
message Filter {
|
message Filter {
|
||||||
enum MatchType {
|
enum MatchType {
|
||||||
MATCH_UNKNOWN = 0;
|
MATCH_UNKNOWN = 0;
|
||||||
STRING_EQUAL = 1;
|
STRING_EQUAL = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
MatchType match_type = 1;
|
||||||
|
|
||||||
|
string name = 2;
|
||||||
|
|
||||||
|
string value = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
MatchType match_type = 1;
|
repeated Filter filters = 2;
|
||||||
|
|
||||||
string name = 2;
|
|
||||||
|
|
||||||
string value = 3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repeated Filter filters = 2;
|
Query query = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
Query query = 2;
|
// Body of search object request message.
|
||||||
|
Body body = 1;
|
||||||
|
|
||||||
// Carries request meta information. Header data is used only to regulate message
|
// Carries request meta information. Header data is used only to regulate message
|
||||||
// transport and does not affect request execution.
|
// 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
|
// Carries request verification information. This header is used to authenticate
|
||||||
// the nodes of the message route and check the correctness of transmission.
|
// 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 SearchResponse {
|
||||||
// Carries list of object identifiers that match the search query.
|
message Body {
|
||||||
repeated refs.ObjectID id_list = 1;
|
// 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.
|
// Range groups the parameters of object payload range.
|
||||||
|
@ -213,47 +307,85 @@ message Range {
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetRangeRequest {
|
message GetRangeRequest {
|
||||||
// Address carries address of the object that contains the requested payload range.
|
message Body {
|
||||||
refs.Address address = 1;
|
// 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 carries the parameters of the requested payload range.
|
||||||
Range range = 2;
|
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
|
// Carries request meta information. Header data is used only to regulate message
|
||||||
// transport and does not affect request execution.
|
// 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
|
// Carries request verification information. This header is used to authenticate
|
||||||
// the nodes of the message route and check the correctness of transmission.
|
// 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 GetRangeResponse {
|
||||||
// Carries part of the object payload.
|
message Body {
|
||||||
bytes chunk = 1;
|
// 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 GetRangeHashRequest {
|
||||||
// Carries address of the object that contains the requested payload range.
|
message Body {
|
||||||
refs.Address address = 1;
|
// Carries address of the object that contains the requested payload range.
|
||||||
|
refs.Address address = 1;
|
||||||
|
|
||||||
// Carries the list of object payload range to calculate homomorphic hash.
|
// Carries the list of object payload range to calculate homomorphic hash.
|
||||||
repeated Range ranges = 2;
|
repeated Range ranges = 2;
|
||||||
|
|
||||||
// Carries binary salt to XOR object payload ranges before hash calculation.
|
// Carries binary salt to XOR object payload ranges before hash calculation.
|
||||||
bytes salt = 3;
|
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
|
// Carries request meta information. Header data is used only to regulate message
|
||||||
// transport and does not affect request execution.
|
// 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
|
// Carries request verification information. This header is used to authenticate
|
||||||
// the nodes of the message route and check the correctness of transmission.
|
// 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 GetRangeHashResponse {
|
||||||
// Carries list of homomorphic hashes in a binary format.
|
message Body {
|
||||||
repeated bytes hash_list = 1;
|
// 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue