2020-01-30 11:41:24 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
package object;
|
2020-03-31 06:58:22 +00:00
|
|
|
option go_package = "github.com/nspcc-dev/neofs-api-go/object";
|
2020-02-05 12:14:39 +00:00
|
|
|
option csharp_namespace = "NeoFS.API.Object";
|
2020-01-30 11:41:24 +00:00
|
|
|
|
|
|
|
import "refs/types.proto";
|
|
|
|
import "object/types.proto";
|
|
|
|
import "service/meta.proto";
|
|
|
|
import "service/verify.proto";
|
|
|
|
|
|
|
|
// Object service provides API for manipulating with the object.
|
|
|
|
service Service {
|
|
|
|
|
|
|
|
// Get the object from container. Response uses gRPC stream. First response
|
|
|
|
// message carry object of requested address. Chunk messages are parts of
|
|
|
|
// the object's payload if it is needed. All messages except first carry
|
|
|
|
// chunks. Requested object can be restored by concatenation of object
|
|
|
|
// message payload and all chunks keeping receiving order.
|
|
|
|
rpc Get(GetRequest) returns (stream GetResponse);
|
|
|
|
|
|
|
|
// Put the object into container. Request uses gRPC stream. First message
|
|
|
|
// SHOULD BE type of PutHeader. Container id and Owner id of object SHOULD
|
|
|
|
// BE set. Session token SHOULD BE obtained before put operation (see
|
|
|
|
// session package). Chunk messages considered by server as part of object
|
|
|
|
// payload. All messages except first SHOULD BE chunks. Chunk messages
|
|
|
|
// SHOULD BE sent in direct order of fragmentation.
|
|
|
|
rpc Put(stream PutRequest) returns (PutResponse);
|
|
|
|
|
|
|
|
// Delete the object from a container
|
|
|
|
rpc Delete(DeleteRequest) returns (DeleteResponse);
|
|
|
|
|
|
|
|
// Head returns the object without data payload. Object in the
|
|
|
|
// response has system header only. If full headers flag is set, extended
|
|
|
|
// headers are also present.
|
|
|
|
rpc Head(HeadRequest) returns (HeadResponse);
|
|
|
|
|
|
|
|
// Search objects in container. Version of query language format SHOULD BE
|
|
|
|
// set to 1. Search query represented in serialized format (see query
|
|
|
|
// package).
|
2020-02-03 09:08:18 +00:00
|
|
|
rpc Search(SearchRequest) returns (stream SearchResponse);
|
2020-01-30 11:41:24 +00:00
|
|
|
|
2020-02-05 10:38:53 +00:00
|
|
|
// GetRange of data payload. Range is a pair (offset, length).
|
|
|
|
// Requested range can be restored by concatenation of all chunks
|
|
|
|
// keeping receiving order.
|
|
|
|
rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse);
|
2020-01-30 11:41:24 +00:00
|
|
|
|
|
|
|
// GetRangeHash returns homomorphic hash of object payload range after XOR
|
|
|
|
// operation. Ranges are set of pairs (offset, length). Hashes order in
|
|
|
|
// response corresponds to ranges order in request. Homomorphic hash is
|
|
|
|
// calculated for XORed data.
|
|
|
|
rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse);
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetRequest {
|
|
|
|
// Address of object (container id + object id)
|
2020-08-05 22:41:03 +00:00
|
|
|
refs.Address Address = 1;
|
2020-08-05 22:55:40 +00:00
|
|
|
// Raw carries the raw option flag of the request.
|
|
|
|
// Raw request is sent to receive only the objects
|
|
|
|
// that are physically stored on the server.
|
|
|
|
bool Raw = 2;
|
2020-01-30 11:41:24 +00:00
|
|
|
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.RequestMetaHeader Meta = 98;
|
2020-01-30 11:41:24 +00:00
|
|
|
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.RequestVerificationHeader Verify = 99;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message GetResponse {
|
|
|
|
oneof R {
|
|
|
|
// Object header and some payload
|
|
|
|
Object object = 1;
|
|
|
|
// Chunk of remaining payload
|
|
|
|
bytes Chunk = 2;
|
|
|
|
}
|
2020-02-13 14:22:25 +00:00
|
|
|
|
|
|
|
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.ResponseMetaHeader Meta = 99;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message PutRequest {
|
|
|
|
message PutHeader {
|
|
|
|
// Object with at least container id and owner id fields
|
|
|
|
Object Object = 1;
|
2020-04-15 15:26:03 +00:00
|
|
|
// Number of the object copies to store within the RPC call (zero is processed according to the placement rules)
|
2020-04-27 10:17:16 +00:00
|
|
|
uint32 CopiesNumber = 2;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
oneof R {
|
|
|
|
// Header should be the first message in the stream
|
|
|
|
PutHeader Header = 1;
|
|
|
|
// Chunk should be a remaining message in stream should be chunks
|
|
|
|
bytes Chunk = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.RequestMetaHeader Meta = 98;
|
2020-01-30 11:41:24 +00:00
|
|
|
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.RequestVerificationHeader Verify = 99;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message PutResponse {
|
|
|
|
// Address of object (container id + object id)
|
2020-08-05 22:41:03 +00:00
|
|
|
refs.Address Address = 1;
|
2020-02-13 14:22:25 +00:00
|
|
|
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.ResponseMetaHeader Meta = 99;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
message DeleteRequest {
|
|
|
|
// Address of object (container id + object id)
|
2020-08-05 22:41:03 +00:00
|
|
|
refs.Address Address = 1;
|
2020-08-05 16:49:16 +00:00
|
|
|
// OwnerID carries identifier of the object owner.
|
|
|
|
refs.OwnerID OwnerID = 2;
|
2020-01-30 11:41:24 +00:00
|
|
|
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.RequestMetaHeader Meta = 98;
|
2020-01-30 11:41:24 +00:00
|
|
|
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.RequestVerificationHeader Verify = 99;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// DeleteResponse is empty because we cannot guarantee permanent object removal
|
|
|
|
// in distributed system.
|
2020-02-13 14:22:25 +00:00
|
|
|
message DeleteResponse {
|
|
|
|
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.ResponseMetaHeader Meta = 99;
|
2020-02-13 14:22:25 +00:00
|
|
|
}
|
2020-01-30 11:41:24 +00:00
|
|
|
|
|
|
|
message HeadRequest {
|
|
|
|
// Address of object (container id + object id)
|
2020-08-05 22:41:03 +00:00
|
|
|
refs.Address Address = 1;
|
2020-01-30 11:41:24 +00:00
|
|
|
// FullHeaders can be set true for extended headers in the object
|
|
|
|
bool FullHeaders = 2;
|
2020-08-05 22:55:40 +00:00
|
|
|
// Raw carries the raw option flag of the request.
|
|
|
|
// Raw request is sent to receive only the headers of the objects
|
|
|
|
// that are physically stored on the server.
|
|
|
|
bool Raw = 3;
|
2020-01-30 11:41:24 +00:00
|
|
|
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.RequestMetaHeader Meta = 98;
|
2020-01-30 11:41:24 +00:00
|
|
|
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.RequestVerificationHeader Verify = 99;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
message HeadResponse {
|
|
|
|
// Object without payload
|
|
|
|
Object Object = 1;
|
2020-02-13 14:22:25 +00:00
|
|
|
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.ResponseMetaHeader Meta = 99;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message SearchRequest {
|
2020-08-05 15:07:56 +00:00
|
|
|
// ContainerID carries search container identifier.
|
|
|
|
refs.ContainerID ContainerID = 1;
|
2020-08-05 18:21:26 +00:00
|
|
|
|
|
|
|
message Query {
|
|
|
|
uint32 Version = 1;
|
|
|
|
|
|
|
|
message Filter {
|
|
|
|
enum MatchType {
|
|
|
|
MatchUnknown = 0;
|
|
|
|
StringEqual = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
MatchType matchType = 1;
|
|
|
|
|
|
|
|
string Name = 2;
|
|
|
|
|
|
|
|
string Value = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
repeated Filter Filters = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
Query query = 2;
|
|
|
|
|
2020-01-30 11:41:24 +00:00
|
|
|
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.RequestMetaHeader Meta = 98;
|
2020-01-30 11:41:24 +00:00
|
|
|
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.RequestVerificationHeader Verify = 99;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message SearchResponse {
|
|
|
|
// Addresses of found objects
|
2020-08-05 22:41:03 +00:00
|
|
|
repeated refs.Address Addresses = 1;
|
2020-02-13 14:22:25 +00:00
|
|
|
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.ResponseMetaHeader Meta = 99;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
2020-08-04 08:43:34 +00:00
|
|
|
message Range {
|
|
|
|
// Offset of the data range
|
|
|
|
uint64 Offset = 1;
|
|
|
|
// Length of the data range
|
|
|
|
uint64 Length = 2;
|
|
|
|
}
|
|
|
|
|
2020-01-30 11:41:24 +00:00
|
|
|
message GetRangeRequest {
|
|
|
|
// Address of object (container id + object id)
|
2020-08-05 22:41:03 +00:00
|
|
|
refs.Address Address = 1;
|
2020-02-05 10:38:53 +00:00
|
|
|
// Range of object's payload to return
|
2020-08-05 22:41:03 +00:00
|
|
|
Range Range = 2;
|
2020-01-30 11:41:24 +00:00
|
|
|
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.RequestMetaHeader Meta = 98;
|
2020-01-30 11:41:24 +00:00
|
|
|
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.RequestVerificationHeader Verify = 99;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message GetRangeResponse {
|
2020-02-05 11:21:15 +00:00
|
|
|
// Fragment of object's payload
|
|
|
|
bytes Fragment = 1;
|
2020-02-13 14:22:25 +00:00
|
|
|
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.ResponseMetaHeader Meta = 99;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message GetRangeHashRequest {
|
|
|
|
// Address of object (container id + object id)
|
2020-08-05 22:41:03 +00:00
|
|
|
refs.Address Address = 1;
|
2020-01-30 11:41:24 +00:00
|
|
|
// Ranges of object's payload to calculate homomorphic hash
|
2020-08-05 22:41:03 +00:00
|
|
|
repeated Range Ranges = 2;
|
2020-01-30 11:41:24 +00:00
|
|
|
// Salt is used to XOR object's payload ranges before hashing, it can be nil
|
|
|
|
bytes Salt = 3;
|
|
|
|
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.RequestMetaHeader Meta = 98;
|
2020-01-30 11:41:24 +00:00
|
|
|
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.RequestVerificationHeader Verify = 99;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message GetRangeHashResponse {
|
|
|
|
// Hashes is a homomorphic hashes of all ranges
|
2020-08-05 22:41:03 +00:00
|
|
|
repeated bytes Hashes = 1;
|
2020-02-13 14:22:25 +00:00
|
|
|
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
|
2020-08-05 22:41:03 +00:00
|
|
|
service.ResponseMetaHeader Meta = 99;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|