frostfs-api/container/types.proto
Stanislav Bogatyrev 063ec430d1 [#86] Clarify that Attributes can't have empty values
In case there is a need to set flag-like attributes, the value should be set to
something like `true` or `1`.

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-12-09 16:51:21 +03:00

60 lines
2.2 KiB
Protocol Buffer

syntax = "proto3";
package neo.fs.v2.container;
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container/grpc;container";
option csharp_namespace = "NeoFS.API.v2.Container";
import "netmap/types.proto";
import "refs/types.proto";
// Container is a structure that defines object placement behaviour. Objects can
// be stored only within containers. They define placement rule, attributes and
// access control information. ID of the container is a 32 byte long SHA256 hash
// of stable-marshalled container message.
message Container {
// Container format version. Effectively the version of API library used to
// create container.
neo.fs.v2.refs.Version version = 1 [json_name = "version"];
// Identifier of the container owner
neo.fs.v2.refs.OwnerID owner_id = 2 [json_name = "ownerID"];
// Nonce is a 16 byte UUID, used to avoid collisions of container id
bytes nonce = 3 [json_name = "nonce"];
// `BasicACL` contains access control rules for owner, system, others groups
// and permission bits for `BearerToken` and `Extended ACL`
uint32 basic_acl = 4 [json_name = "basicACL"];
// `Attribute` is a user-defined Key-Value metadata pair attached to the
// container. Container attributes are immutable. They are set at container
// creation and can never be added or updated.
//
// Key name must be a valid UTF-8 string. Value can't be empty.
//
// There are some "well-known" attributes affecting system behaviour:
//
// * __NEOFS__SUBNET \
// String ID of container's storage subnet. Container can be attached to
// only one subnet.
//
// And some well-known attributes used by applications only:
//
// * Name \
// Human-friendly name
// * Timestamp \
// User-defined local time of container creation in Unix Timestamp format
message Attribute {
// Attribute name key
string key = 1 [json_name = "key"];
// Attribute value
string value = 2 [json_name = "value"];
}
// Attributes represent immutable container's meta data
repeated Attribute attributes = 5 [json_name = "attributes"];
// Placement policy for the object inside the container
neo.fs.v2.netmap.PlacementPolicy placement_policy = 6 [json_name = "placementPolicy"];
}