frostfs-api-go/object/service.proto

205 lines
11 KiB
Protocol Buffer
Raw Normal View History

2019-11-18 13:34:06 +00:00
syntax = "proto3";
package object;
option go_package = "github.com/nspcc-dev/neofs-api/object";
2020-02-05 13:58:06 +00:00
option csharp_namespace = "NeoFS.API.Object";
2019-11-18 13:34:06 +00:00
import "refs/types.proto";
import "object/types.proto";
import "session/types.proto";
2019-11-18 16:22:08 +00:00
import "service/meta.proto";
import "service/verify.proto";
2019-11-18 13:34:06 +00:00
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.stable_marshaler_all) = true;
2019-11-20 15:50:10 +00:00
// Object service provides API for manipulating with the object.
2019-11-18 13:34:06 +00:00
service Service {
2019-11-20 15:50:10 +00:00
// 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.
2019-11-18 13:34:06 +00:00
rpc Get(GetRequest) returns (stream GetResponse);
2019-11-20 15:50:10 +00:00
// 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.
2019-11-18 13:34:06 +00:00
rpc Put(stream PutRequest) returns (PutResponse);
// Delete the object from a container
rpc Delete(DeleteRequest) returns (DeleteResponse);
2019-11-20 15:50:10 +00:00
// 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.
2019-11-18 13:34:06 +00:00
rpc Head(HeadRequest) returns (HeadResponse);
2019-11-20 15:50:10 +00:00
// 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:36:37 +00:00
rpc Search(SearchRequest) returns (stream SearchResponse);
2019-11-18 13:34:06 +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);
2019-11-18 13:34:06 +00:00
2019-11-20 15:50:10 +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.
2019-11-18 13:34:06 +00:00
rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse);
}
message GetRequest {
// Address of object (container id + object id)
2019-11-18 16:22:08 +00:00
refs.Address Address = 1 [(gogoproto.nullable) = false];
// Raw is the request flag of a physically stored representation of an object
bool Raw = 2;
2019-11-18 16:22:08 +00:00
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
2019-11-18 13:34:06 +00:00
}
message GetResponse {
oneof R {
// Object header and some payload
Object object = 1;
// Chunk of remaining payload
bytes Chunk = 2;
2019-11-18 13:34:06 +00:00
}
2020-02-13 15:10:46 +00:00
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
2019-11-18 13:34:06 +00:00
}
message PutRequest {
message PutHeader {
// Object with at least container id and owner id fields
2019-11-18 16:22:08 +00:00
Object Object = 1;
// Token with session public key and user's signature
2019-11-18 16:22:08 +00:00
session.Token Token = 2;
2019-11-18 13:34:06 +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;
2019-11-18 13:34:06 +00:00
}
2019-11-18 16:22:08 +00:00
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
2019-11-18 13:34:06 +00:00
}
message PutResponse {
// Address of object (container id + object id)
refs.Address Address = 1 [(gogoproto.nullable) = false];
2020-02-13 15:10:46 +00:00
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
2019-11-18 13:34:06 +00:00
}
message DeleteRequest {
// Address of object (container id + object id)
2019-11-18 16:22:08 +00:00
refs.Address Address = 1 [(gogoproto.nullable) = false];
// OwnerID is a wallet address
2019-11-18 16:22:08 +00:00
bytes OwnerID = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "OwnerID"];
// Token with session public key and user's signature
2019-11-18 16:22:08 +00:00
session.Token Token = 3;
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
2019-11-18 13:34:06 +00:00
}
2019-11-20 15:50:10 +00:00
// DeleteResponse is empty because we cannot guarantee permanent object removal
// in distributed system.
2020-02-13 15:10:46 +00:00
message DeleteResponse {
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
}
2019-11-18 13:34:06 +00:00
message HeadRequest {
// Address of object (container id + object id)
2019-11-18 16:22:08 +00:00
refs.Address Address = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "Address"];
// FullHeaders can be set true for extended headers in the object
2019-11-18 16:22:08 +00:00
bool FullHeaders = 2;
// Raw is the request flag of a physically stored representation of an object
bool Raw = 3;
2019-11-18 16:22:08 +00:00
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
2019-11-18 13:34:06 +00:00
}
message HeadResponse {
// Object without payload
Object Object = 1;
2020-02-13 15:10:46 +00:00
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
2019-11-18 13:34:06 +00:00
}
message SearchRequest {
// ContainerID for searching the object
bytes ContainerID = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "CID"];
// Query in the binary serialized format
bytes Query = 2;
// QueryVersion is a version of search query format
uint32 QueryVersion = 3;
2019-11-18 16:22:08 +00:00
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
2019-11-18 13:34:06 +00:00
}
message SearchResponse {
// Addresses of found objects
repeated refs.Address Addresses = 1 [(gogoproto.nullable) = false];
2020-02-13 15:10:46 +00:00
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
2019-11-18 13:34:06 +00:00
}
message GetRangeRequest {
// Address of object (container id + object id)
2019-11-18 16:22:08 +00:00
refs.Address Address = 1 [(gogoproto.nullable) = false];
// Range of object's payload to return
Range Range = 2 [(gogoproto.nullable) = false];
2019-11-18 16:22:08 +00:00
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
2019-11-18 13:34:06 +00:00
}
message GetRangeResponse {
2020-02-05 11:34:23 +00:00
// Fragment of object's payload
bytes Fragment = 1;
2020-02-13 15:10:46 +00:00
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
2019-11-18 13:34:06 +00:00
}
message GetRangeHashRequest {
// Address of object (container id + object id)
2019-11-18 16:22:08 +00:00
refs.Address Address = 1 [(gogoproto.nullable) = false];
// Ranges of object's payload to calculate homomorphic hash
2019-11-18 16:22:08 +00:00
repeated Range Ranges = 2 [(gogoproto.nullable) = false];
// Salt is used to XOR object's payload ranges before hashing, it can be nil
2019-11-18 16:22:08 +00:00
bytes Salt = 3;
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
2019-11-18 13:34:06 +00:00
}
message GetRangeHashResponse {
// Hashes is a homomorphic hashes of all ranges
repeated bytes Hashes = 1 [(gogoproto.customtype) = "Hash", (gogoproto.nullable) = false];
2020-02-13 15:10:46 +00:00
// ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message)
service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
2019-11-18 13:34:06 +00:00
}