2020-01-30 11:41:24 +00:00
|
|
|
syntax = "proto3";
|
2020-08-04 21:10:51 +00:00
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
package neo.fs.v2.object;
|
2020-08-04 21:10:51 +00:00
|
|
|
|
2023-03-07 08:50:02 +00:00
|
|
|
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc;object";
|
2021-03-10 10:54:06 +00:00
|
|
|
option csharp_namespace = "Neo.FileStorage.API.Object";
|
2020-01-30 11:41:24 +00:00
|
|
|
|
|
|
|
import "refs/types.proto";
|
2020-08-18 13:49:05 +00:00
|
|
|
import "session/types.proto";
|
2020-01-30 11:41:24 +00:00
|
|
|
|
2020-11-09 20:29:52 +00:00
|
|
|
// Type of the object payload content. Only `REGULAR` type objects can be split,
|
2023-08-17 08:04:47 +00:00
|
|
|
// hence `TOMBSTONE` and `LOCK` payload is limited by the
|
|
|
|
// maximum object size.
|
2020-12-08 15:08:32 +00:00
|
|
|
//
|
2021-08-25 10:21:10 +00:00
|
|
|
// String presentation of object type is the same as definition:
|
|
|
|
// * REGULAR
|
|
|
|
// * TOMBSTONE
|
2022-02-15 05:06:19 +00:00
|
|
|
// * LOCK
|
2020-08-11 10:54:58 +00:00
|
|
|
enum ObjectType {
|
|
|
|
// Just a normal object
|
|
|
|
REGULAR = 0;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Used internally to identify deleted objects
|
|
|
|
TOMBSTONE = 1;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2023-08-17 08:04:47 +00:00
|
|
|
// Unused (previously storageGroup information)
|
|
|
|
// _ = 2;
|
2022-02-15 05:06:19 +00:00
|
|
|
|
|
|
|
// Object lock
|
|
|
|
LOCK = 3;
|
2020-08-11 10:54:58 +00:00
|
|
|
}
|
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Type of match expression
|
|
|
|
enum MatchType {
|
|
|
|
// Unknown. Not used
|
|
|
|
MATCH_TYPE_UNSPECIFIED = 0;
|
2020-10-19 08:27:05 +00:00
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Full string match
|
|
|
|
STRING_EQUAL = 1;
|
2021-02-01 17:27:00 +00:00
|
|
|
|
|
|
|
// Full string mismatch
|
|
|
|
STRING_NOT_EQUAL = 2;
|
2021-02-02 08:49:27 +00:00
|
|
|
|
|
|
|
// Lack of key
|
|
|
|
NOT_PRESENT = 3;
|
2021-08-16 07:25:06 +00:00
|
|
|
|
|
|
|
// String prefix match
|
|
|
|
COMMON_PREFIX = 4;
|
2020-08-14 19:04:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Short header fields
|
|
|
|
message ShortHeader {
|
2022-04-13 06:21:33 +00:00
|
|
|
// Object format version. Effectively, the version of API library used to
|
2020-12-08 15:08:32 +00:00
|
|
|
// create particular object.
|
2023-08-17 08:04:47 +00:00
|
|
|
neo.fs.v2.refs.Version version = 1 [ json_name = "version" ];
|
2020-08-14 19:04:56 +00:00
|
|
|
|
|
|
|
// Epoch when the object was created
|
2023-08-17 08:04:47 +00:00
|
|
|
uint64 creation_epoch = 2 [ json_name = "creationEpoch" ];
|
2020-08-14 19:04:56 +00:00
|
|
|
|
|
|
|
// Object's owner
|
2023-08-17 08:04:47 +00:00
|
|
|
neo.fs.v2.refs.OwnerID owner_id = 3 [ json_name = "ownerID" ];
|
2020-08-14 19:04:56 +00:00
|
|
|
|
|
|
|
// Type of the object payload content
|
2023-08-17 08:04:47 +00:00
|
|
|
ObjectType object_type = 4 [ json_name = "objectType" ];
|
2020-08-14 19:04:56 +00:00
|
|
|
|
|
|
|
// Size of payload in bytes.
|
2020-10-15 18:28:19 +00:00
|
|
|
// `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown
|
2023-08-17 08:04:47 +00:00
|
|
|
uint64 payload_length = 5 [ json_name = "payloadLength" ];
|
2020-12-17 07:53:40 +00:00
|
|
|
|
|
|
|
// Hash of payload bytes
|
2023-08-17 08:04:47 +00:00
|
|
|
neo.fs.v2.refs.Checksum payload_hash = 6 [ json_name = "payloadHash" ];
|
2020-12-17 07:53:40 +00:00
|
|
|
|
|
|
|
// Homomorphic hash of the object payload
|
2023-08-17 08:04:47 +00:00
|
|
|
neo.fs.v2.refs.Checksum homomorphic_hash = 7
|
|
|
|
[ json_name = "homomorphicHash" ];
|
2020-08-14 19:04:56 +00:00
|
|
|
}
|
|
|
|
|
2020-10-15 18:28:19 +00:00
|
|
|
// Object Header
|
2020-08-04 20:43:33 +00:00
|
|
|
message Header {
|
2022-04-13 06:21:33 +00:00
|
|
|
// Object format version. Effectively, the version of API library used to
|
2020-10-15 18:28:19 +00:00
|
|
|
// create particular object
|
2023-08-17 08:04:47 +00:00
|
|
|
neo.fs.v2.refs.Version version = 1 [ json_name = "version" ];
|
2020-08-14 19:44:32 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Object's container
|
2023-08-17 08:04:47 +00:00
|
|
|
neo.fs.v2.refs.ContainerID container_id = 2 [ json_name = "containerID" ];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Object's owner
|
2023-08-17 08:04:47 +00:00
|
|
|
neo.fs.v2.refs.OwnerID owner_id = 3 [ json_name = "ownerID" ];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-14 19:44:32 +00:00
|
|
|
// Object creation Epoch
|
2023-08-17 08:04:47 +00:00
|
|
|
uint64 creation_epoch = 4 [ json_name = "creationEpoch" ];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Size of payload in bytes.
|
2020-12-08 15:08:32 +00:00
|
|
|
// `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown.
|
2023-08-17 08:04:47 +00:00
|
|
|
uint64 payload_length = 5 [ json_name = "payloadLength" ];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Hash of payload bytes
|
2023-08-17 08:04:47 +00:00
|
|
|
neo.fs.v2.refs.Checksum payload_hash = 6 [ json_name = "payloadHash" ];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-10-15 18:28:19 +00:00
|
|
|
// Type of the object payload content
|
2023-08-17 08:04:47 +00:00
|
|
|
ObjectType object_type = 7 [ json_name = "objectType" ];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-12-08 15:08:32 +00:00
|
|
|
// Homomorphic hash of the object payload
|
2023-08-17 08:04:47 +00:00
|
|
|
neo.fs.v2.refs.Checksum homomorphic_hash = 8
|
|
|
|
[ json_name = "homomorphicHash" ];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-10-15 18:28:19 +00:00
|
|
|
// Session token, if it was used during Object creation. Need it to verify
|
|
|
|
// integrity and authenticity out of Request scope.
|
2023-08-17 08:04:47 +00:00
|
|
|
neo.fs.v2.session.SessionToken session_token = 9
|
|
|
|
[ json_name = "sessionToken" ];
|
2020-08-11 10:54:58 +00:00
|
|
|
|
2022-04-13 06:21:33 +00:00
|
|
|
// `Attribute` is a user-defined Key-Value metadata pair attached to an
|
2020-10-13 15:29:09 +00:00
|
|
|
// object.
|
|
|
|
//
|
2022-04-13 06:21:33 +00:00
|
|
|
// Key name must be an object-unique valid UTF-8 string. Value can't be empty.
|
2020-12-11 06:46:00 +00:00
|
|
|
// Objects with duplicated attribute names or attributes with empty values
|
|
|
|
// will be considered invalid.
|
2020-12-08 10:48:51 +00:00
|
|
|
//
|
2023-08-17 08:04:47 +00:00
|
|
|
// There are some "well-known" attributes starting with `__SYSTEM__`
|
|
|
|
// (`__NEOFS__` is deprecated) prefix that affect system behaviour:
|
2020-10-13 15:29:09 +00:00
|
|
|
//
|
2023-03-14 07:24:35 +00:00
|
|
|
// * [ __SYSTEM__UPLOAD_ID ] \
|
|
|
|
// (`__NEOFS__UPLOAD_ID` is deprecated) \
|
2020-10-20 20:09:51 +00:00
|
|
|
// Marks smaller parts of a split bigger object
|
2023-03-14 07:24:35 +00:00
|
|
|
// * [ __SYSTEM__EXPIRATION_EPOCH ] \
|
|
|
|
// (`__NEOFS__EXPIRATION_EPOCH` is deprecated) \
|
2023-09-05 06:55:35 +00:00
|
|
|
// The epoch after which object with no LOCKs on it becomes unavailable.
|
|
|
|
// Locked object continues to be available until each of the LOCKs expire.
|
2023-03-14 07:24:35 +00:00
|
|
|
// * [ __SYSTEM__TICK_EPOCH ] \
|
|
|
|
// (`__NEOFS__TICK_EPOCH` is deprecated) \
|
2022-02-14 16:29:51 +00:00
|
|
|
// Decimal number that defines what epoch must produce
|
|
|
|
// object notification with UTF-8 object address in a
|
|
|
|
// body (`0` value produces notification right after
|
|
|
|
// object put)
|
2023-03-14 07:24:35 +00:00
|
|
|
// * [ __SYSTEM__TICK_TOPIC ] \
|
|
|
|
// (`__NEOFS__TICK_TOPIC` is deprecated) \
|
2022-02-14 16:29:51 +00:00
|
|
|
// UTF-8 string topic ID that is used for object notification
|
2020-10-20 20:09:51 +00:00
|
|
|
//
|
|
|
|
// And some well-known attributes used by applications only:
|
|
|
|
//
|
|
|
|
// * Name \
|
|
|
|
// Human-friendly name
|
|
|
|
// * FileName \
|
|
|
|
// File name to be associated with the object on saving
|
2022-08-26 09:32:10 +00:00
|
|
|
// * FilePath \
|
|
|
|
// Full path to be associated with the object on saving. Should start with a
|
|
|
|
// '/' and use '/' as a delimiting symbol. Trailing '/' should be
|
|
|
|
// interpreted as a virtual directory marker. If an object has conflicting
|
|
|
|
// FilePath and FileName, FilePath should have higher priority, because it
|
|
|
|
// is used to construct the directory tree. FilePath with trailing '/' and
|
|
|
|
// non-empty FileName attribute should not be used together.
|
2020-10-20 20:09:51 +00:00
|
|
|
// * Timestamp \
|
|
|
|
// User-defined local time of object creation in Unix Timestamp format
|
2021-03-12 19:25:00 +00:00
|
|
|
// * Content-Type \
|
|
|
|
// MIME Content Type of object's payload
|
2020-10-13 15:29:09 +00:00
|
|
|
//
|
|
|
|
// For detailed description of each well-known attribute please see the
|
2024-09-05 13:24:35 +00:00
|
|
|
// corresponding section in FrostFS Technical Specification.
|
2020-08-11 10:54:58 +00:00
|
|
|
message Attribute {
|
|
|
|
// string key to the object attribute
|
2023-08-17 08:04:47 +00:00
|
|
|
string key = 1 [ json_name = "key" ];
|
2020-08-11 10:54:58 +00:00
|
|
|
// string value of the object attribute
|
2023-08-17 08:04:47 +00:00
|
|
|
string value = 2 [ json_name = "value" ];
|
2020-08-11 09:03:50 +00:00
|
|
|
}
|
2020-08-12 21:43:51 +00:00
|
|
|
// User-defined object attributes
|
2023-08-17 08:04:47 +00:00
|
|
|
repeated Attribute attributes = 10 [ json_name = "attributes" ];
|
2020-08-11 10:54:58 +00:00
|
|
|
|
2020-10-15 18:28:19 +00:00
|
|
|
// Bigger objects can be split into a chain of smaller objects. Information
|
|
|
|
// about inter-dependencies between spawned objects and how to re-construct
|
|
|
|
// the original one is in the `Split` headers. Parent and children objects
|
|
|
|
// must be within the same container.
|
2020-08-11 10:54:58 +00:00
|
|
|
message Split {
|
2020-10-15 18:28:19 +00:00
|
|
|
// Identifier of the origin object. Known only to the minor child.
|
2023-08-17 08:04:47 +00:00
|
|
|
neo.fs.v2.refs.ObjectID parent = 1 [ json_name = "parent" ];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-10-15 18:28:19 +00:00
|
|
|
// Identifier of the left split neighbor
|
2023-08-17 08:04:47 +00:00
|
|
|
neo.fs.v2.refs.ObjectID previous = 2 [ json_name = "previous" ];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// `signature` field of the parent object. Used to reconstruct parent.
|
2023-08-17 08:04:47 +00:00
|
|
|
neo.fs.v2.refs.Signature parent_signature = 3
|
|
|
|
[ json_name = "parentSignature" ];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// `header` field of the parent object. Used to reconstruct parent.
|
2023-08-17 08:04:47 +00:00
|
|
|
Header parent_header = 4 [ json_name = "parentHeader" ];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-10-15 18:28:19 +00:00
|
|
|
// List of identifiers of the objects generated by splitting current one.
|
2023-08-17 08:04:47 +00:00
|
|
|
repeated neo.fs.v2.refs.ObjectID children = 5 [ json_name = "children" ];
|
2020-11-17 06:37:12 +00:00
|
|
|
|
2020-12-08 15:08:32 +00:00
|
|
|
// 16 byte UUIDv4 used to identify the split object hierarchy parts. Must be
|
|
|
|
// unique inside container. All objects participating in the split must have
|
|
|
|
// the same `split_id` value.
|
2023-08-17 08:04:47 +00:00
|
|
|
bytes split_id = 6 [ json_name = "splitID" ];
|
2020-08-11 09:03:50 +00:00
|
|
|
}
|
2020-10-15 18:28:19 +00:00
|
|
|
// Position of the object in the split hierarchy
|
2023-08-17 08:04:47 +00:00
|
|
|
Split split = 11 [ json_name = "split" ];
|
2024-02-28 10:42:59 +00:00
|
|
|
|
|
|
|
// Erasure code can be applied to any object.
|
|
|
|
// Information about encoded object structure is stored in `EC` header.
|
|
|
|
// All objects belonging to a single EC group have the same `parent` field.
|
|
|
|
message EC {
|
|
|
|
// Identifier of the origin object. Known to all chunks.
|
|
|
|
neo.fs.v2.refs.ObjectID parent = 1 [ json_name = "parent" ];
|
|
|
|
// Index of this chunk.
|
|
|
|
uint32 index = 2 [ json_name = "index" ];
|
|
|
|
// Total number of chunks in this split.
|
|
|
|
uint32 total = 3 [ json_name = "total" ];
|
|
|
|
// Total length of a parent header. Used to trim padding zeroes.
|
|
|
|
uint32 header_length = 4 [ json_name = "headerLength" ];
|
|
|
|
// Chunk of a parent header.
|
|
|
|
bytes header = 5 [ json_name = "header" ];
|
2024-05-08 10:07:33 +00:00
|
|
|
// As the origin object is EC-splitted its identifier is known to all
|
2024-07-25 15:19:02 +00:00
|
|
|
// chunks as parent. But parent itself can be a part of Split (does not
|
|
|
|
// relate to EC-split). In this case parent_split_id should be set.
|
2024-05-08 10:07:33 +00:00
|
|
|
bytes parent_split_id = 6 [ json_name = "parentSplitID" ];
|
2024-07-25 15:19:02 +00:00
|
|
|
// EC-parent's parent ID. parent_split_parent_id is set if EC-parent,
|
|
|
|
// itself, is a part of Split and if an object ID of its parent is
|
|
|
|
// presented. The field allows to determine how EC-chunk is placed in Split
|
|
|
|
// hierarchy.
|
|
|
|
neo.fs.v2.refs.ObjectID parent_split_parent_id = 7
|
|
|
|
[ json_name = "parentSplitParentID" ];
|
2024-05-23 19:40:45 +00:00
|
|
|
// EC parent's attributes.
|
|
|
|
repeated Attribute parent_attributes = 8 [ json_name = "parentAttributes" ];
|
2024-02-28 10:42:59 +00:00
|
|
|
}
|
|
|
|
// Erasure code chunk information.
|
|
|
|
EC ec = 12 [ json_name = "ec" ];
|
2020-08-04 10:18:38 +00:00
|
|
|
}
|
|
|
|
|
2020-10-15 18:28:19 +00:00
|
|
|
// Object structure. Object is immutable and content-addressed. It means
|
2023-08-17 08:04:47 +00:00
|
|
|
// `ObjectID` will change if the header or the payload changes. It's calculated
|
|
|
|
// as a hash of header field which contains hash of the object's payload.
|
2022-02-16 07:13:43 +00:00
|
|
|
//
|
2022-02-21 09:47:21 +00:00
|
|
|
// For non-regular object types payload format depends on object type specified
|
|
|
|
// in the header.
|
2020-08-04 10:18:38 +00:00
|
|
|
message Object {
|
2020-08-11 10:54:58 +00:00
|
|
|
// Object's unique identifier.
|
2023-08-17 08:04:47 +00:00
|
|
|
neo.fs.v2.refs.ObjectID object_id = 1 [ json_name = "objectID" ];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Signed object_id
|
2023-08-17 08:04:47 +00:00
|
|
|
neo.fs.v2.refs.Signature signature = 2 [ json_name = "signature" ];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Object metadata headers
|
2023-08-17 08:04:47 +00:00
|
|
|
Header header = 3 [ json_name = "header" ];
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-12-08 15:08:32 +00:00
|
|
|
// Payload bytes
|
2023-08-17 08:04:47 +00:00
|
|
|
bytes payload = 4 [ json_name = "payload" ];
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
2020-12-02 08:33:15 +00:00
|
|
|
|
2022-04-13 06:21:33 +00:00
|
|
|
// Meta information of split hierarchy for object assembly. With the last part
|
|
|
|
// one can traverse linked list of split hierarchy back to the first part and
|
2023-08-17 08:04:47 +00:00
|
|
|
// assemble the original object. With a linking object one can assemble an
|
|
|
|
// object right from the object parts.
|
2020-12-02 08:33:15 +00:00
|
|
|
message SplitInfo {
|
|
|
|
// 16 byte UUID used to identify the split object hierarchy parts.
|
|
|
|
bytes split_id = 1;
|
|
|
|
|
2022-04-13 06:21:33 +00:00
|
|
|
// The identifier of the last object in split hierarchy parts. It contains
|
|
|
|
// split header with the original object header.
|
2020-12-02 08:33:15 +00:00
|
|
|
neo.fs.v2.refs.ObjectID last_part = 2;
|
|
|
|
|
2022-04-13 06:21:33 +00:00
|
|
|
// The identifier of a linking object for split hierarchy parts. It contains
|
|
|
|
// split header with the original object header and a sorted list of
|
2020-12-02 08:33:15 +00:00
|
|
|
// object parts.
|
|
|
|
neo.fs.v2.refs.ObjectID link = 3;
|
|
|
|
}
|
2024-02-28 10:42:59 +00:00
|
|
|
|
|
|
|
// Meta information for the erasure-encoded object.
|
|
|
|
message ECInfo {
|
|
|
|
message Chunk {
|
|
|
|
// Object ID of the chunk.
|
|
|
|
neo.fs.v2.refs.ObjectID id = 1;
|
|
|
|
// Index of the chunk.
|
|
|
|
uint32 index = 2;
|
|
|
|
// Total number of chunks in this split.
|
|
|
|
uint32 total = 3;
|
|
|
|
}
|
|
|
|
// Chunk stored on the node.
|
|
|
|
repeated Chunk chunks = 1;
|
2024-09-02 12:03:58 +00:00
|
|
|
}
|