2019-11-18 13:34:06 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
package container;
|
2020-01-30 13:32:50 +00:00
|
|
|
option go_package = "github.com/nspcc-dev/neofs-api/container";
|
2020-02-05 13:58:06 +00:00
|
|
|
option csharp_namespace = "NeoFS.API.Container";
|
2019-11-18 13:34:06 +00:00
|
|
|
|
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 "container/types.proto";
|
|
|
|
import "github.com/nspcc-dev/netmap/selector.proto";
|
|
|
|
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
|
|
|
|
|
|
|
option (gogoproto.stable_marshaler_all) = true;
|
|
|
|
|
2019-11-20 17:16:24 +00:00
|
|
|
// Container service provides API for manipulating with the container.
|
2019-11-18 13:34:06 +00:00
|
|
|
service Service {
|
2019-11-20 17:16:24 +00:00
|
|
|
// Put request proposes container to the inner ring nodes. They will
|
|
|
|
// accept new container if user has enough deposit. All containers
|
|
|
|
// are accepted by the consensus, therefore it is asynchronous process.
|
2019-11-18 13:34:06 +00:00
|
|
|
rpc Put(PutRequest) returns (PutResponse);
|
|
|
|
|
2019-11-20 17:16:24 +00:00
|
|
|
// Delete container removes it from the inner ring container storage. It
|
|
|
|
// also asynchronous process done by consensus.
|
2019-11-18 13:34:06 +00:00
|
|
|
rpc Delete(DeleteRequest) returns (DeleteResponse);
|
|
|
|
|
2019-11-20 17:16:24 +00:00
|
|
|
// Get container returns container instance
|
2019-11-18 13:34:06 +00:00
|
|
|
rpc Get(GetRequest) returns (GetResponse);
|
|
|
|
|
2019-11-20 17:16:24 +00:00
|
|
|
// List returns all user's containers
|
2019-11-18 13:34:06 +00:00
|
|
|
rpc List(ListRequest) returns (ListResponse);
|
|
|
|
}
|
|
|
|
|
|
|
|
message PutRequest {
|
2019-11-20 17:16:24 +00:00
|
|
|
// MessageID is a nonce for uniq container id calculation
|
2019-11-18 16:22:08 +00:00
|
|
|
bytes MessageID = 1 [(gogoproto.customtype) = "MessageID", (gogoproto.nullable) = false];
|
2019-11-20 17:16:24 +00:00
|
|
|
|
|
|
|
// Capacity defines amount of data that can be stored in the container (doesn't used for now).
|
2019-11-18 16:22:08 +00:00
|
|
|
uint64 Capacity = 2;
|
2019-11-20 17:16:24 +00:00
|
|
|
|
|
|
|
// OwnerID is a wallet address
|
2019-11-18 16:22:08 +00:00
|
|
|
bytes OwnerID = 3 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
|
2019-11-20 17:16:24 +00:00
|
|
|
|
|
|
|
// Rules define storage policy for the object inside the container.
|
2019-11-18 16:22:08 +00:00
|
|
|
netmap.PlacementRule rules = 4 [(gogoproto.nullable) = false];
|
2019-11-20 17:16:24 +00:00
|
|
|
|
2019-12-17 12:35:38 +00:00
|
|
|
// Container ACL.
|
|
|
|
AccessGroup Group = 5 [(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 PutResponse {
|
2019-11-20 17:16:24 +00:00
|
|
|
// CID (container id) is a SHA256 hash of the container structure
|
2019-11-18 13:34:06 +00:00
|
|
|
bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
|
|
|
message DeleteRequest {
|
2019-11-20 17:16:24 +00:00
|
|
|
// CID (container id) is a SHA256 hash of the container structure
|
2019-11-18 16:22:08 +00:00
|
|
|
bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false];
|
2019-11-20 17:16:24 +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
|
|
|
}
|
|
|
|
|
2019-11-20 17:16:24 +00:00
|
|
|
// DeleteResponse is empty because delete operation is asynchronous and done
|
|
|
|
// via consensus in inner ring nodes
|
2019-11-18 13:34:06 +00:00
|
|
|
message DeleteResponse { }
|
|
|
|
|
|
|
|
|
|
|
|
message GetRequest {
|
2019-11-20 17:16:24 +00:00
|
|
|
// CID (container id) is a SHA256 hash of the container structure
|
2019-11-18 16:22:08 +00:00
|
|
|
bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false];
|
2019-11-20 17:16:24 +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 GetResponse {
|
2019-11-20 17:16:24 +00:00
|
|
|
// Container is a structure that contains placement rules and owner id
|
2019-11-18 13:34:06 +00:00
|
|
|
container.Container Container = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ListRequest {
|
2019-11-20 17:16:24 +00:00
|
|
|
// OwnerID is a wallet address
|
2019-11-18 16:22:08 +00:00
|
|
|
bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
|
|
|
|
// 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 ListResponse {
|
2019-11-20 17:16:24 +00:00
|
|
|
// CID (container id) is list of SHA256 hashes of the container structures
|
2019-11-18 13:34:06 +00:00
|
|
|
repeated bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false];
|
|
|
|
}
|