forked from TrueCloudLab/frostfs-api
[#39] Makefile: Add fmt target
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
188f580e46
commit
4c68d92468
15 changed files with 379 additions and 364 deletions
6
Makefile
6
Makefile
|
@ -19,3 +19,9 @@ doc:
|
||||||
--proto_path=.:/usr/local/include \
|
--proto_path=.:/usr/local/include \
|
||||||
--doc_out=proto-docs/ $${f}/*.proto; \
|
--doc_out=proto-docs/ $${f}/*.proto; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
fmt:
|
||||||
|
@for f in `ls **/*.proto`; do \
|
||||||
|
echo "⇒ Formatting $$f"; \
|
||||||
|
clang-format -i $$f; \
|
||||||
|
done
|
||||||
|
|
|
@ -21,7 +21,7 @@ service AccountingService {
|
||||||
// - **OK** (0, SECTION_SUCCESS):
|
// - **OK** (0, SECTION_SUCCESS):
|
||||||
// balance has been successfully read;
|
// balance has been successfully read;
|
||||||
// - Common failures (SECTION_FAILURE_COMMON).
|
// - Common failures (SECTION_FAILURE_COMMON).
|
||||||
rpc Balance (BalanceRequest) returns (BalanceResponse);
|
rpc Balance(BalanceRequest) returns (BalanceResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
// BalanceRequest message
|
// BalanceRequest message
|
||||||
|
@ -51,7 +51,8 @@ message BalanceRequest {
|
||||||
// BalanceResponse message
|
// BalanceResponse message
|
||||||
message BalanceResponse {
|
message BalanceResponse {
|
||||||
// The amount of funds in GAS token for the `OwnerID`'s account requested.
|
// The amount of funds in GAS token for the `OwnerID`'s account requested.
|
||||||
// Balance is given in the `Decimal` format to avoid precision issues with rounding.
|
// Balance is given in the `Decimal` format to avoid precision issues with
|
||||||
|
// rounding.
|
||||||
message Body {
|
message Body {
|
||||||
// Amount of funds in GAS token for the requested account.
|
// Amount of funds in GAS token for the requested account.
|
||||||
Decimal balance = 1;
|
Decimal balance = 1;
|
||||||
|
|
|
@ -14,9 +14,9 @@ option csharp_namespace = "Neo.FileStorage.API.Accounting";
|
||||||
// description.
|
// description.
|
||||||
message Decimal {
|
message Decimal {
|
||||||
// Number in the smallest Token fractions.
|
// Number in the smallest Token fractions.
|
||||||
int64 value = 1 [json_name = "value"];
|
int64 value = 1 [ json_name = "value" ];
|
||||||
|
|
||||||
// Precision value indicating how many smallest fractions can be in one
|
// Precision value indicating how many smallest fractions can be in one
|
||||||
// integer.
|
// integer.
|
||||||
uint32 precision = 2 [json_name = "precision"];
|
uint32 precision = 2 [ json_name = "precision" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,8 @@ enum Role {
|
||||||
// container or an inner ring node
|
// container or an inner ring node
|
||||||
SYSTEM = 2;
|
SYSTEM = 2;
|
||||||
|
|
||||||
// Others target rule is applied if sender is neither a user nor a system target
|
// Others target rule is applied if sender is neither a user nor a system
|
||||||
|
// target
|
||||||
OTHERS = 3;
|
OTHERS = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,10 +96,10 @@ enum HeaderType {
|
||||||
// Describes a single eACL rule.
|
// Describes a single eACL rule.
|
||||||
message EACLRecord {
|
message EACLRecord {
|
||||||
// NeoFS request Verb to match
|
// NeoFS request Verb to match
|
||||||
Operation operation = 1 [json_name = "operation"];
|
Operation operation = 1 [ json_name = "operation" ];
|
||||||
|
|
||||||
// Rule execution result. Either allows or denies access if filters match.
|
// Rule execution result. Either allows or denies access if filters match.
|
||||||
Action action = 2 [json_name = "action"];
|
Action action = 2 [ json_name = "action" ];
|
||||||
|
|
||||||
// Filter to check particular properties of the request or the object.
|
// Filter to check particular properties of the request or the object.
|
||||||
//
|
//
|
||||||
|
@ -132,32 +133,32 @@ message EACLRecord {
|
||||||
// it's possible to take that information from the requested address.
|
// it's possible to take that information from the requested address.
|
||||||
message Filter {
|
message Filter {
|
||||||
// Define if Object or Request header will be used
|
// Define if Object or Request header will be used
|
||||||
HeaderType header_type = 1 [json_name = "headerType"];
|
HeaderType header_type = 1 [ json_name = "headerType" ];
|
||||||
|
|
||||||
// Match operation type
|
// Match operation type
|
||||||
MatchType match_type = 2 [json_name = "matchType"];
|
MatchType match_type = 2 [ json_name = "matchType" ];
|
||||||
|
|
||||||
// Name of the Header to use
|
// Name of the Header to use
|
||||||
string key = 3 [json_name="key"];
|
string key = 3 [ json_name = "key" ];
|
||||||
|
|
||||||
// Expected Header Value or pattern to match
|
// Expected Header Value or pattern to match
|
||||||
string value = 4 [json_name="value"];
|
string value = 4 [ json_name = "value" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of filters to match and see if rule is applicable
|
// List of filters to match and see if rule is applicable
|
||||||
repeated Filter filters = 3 [json_name="filters"];
|
repeated Filter filters = 3 [ json_name = "filters" ];
|
||||||
|
|
||||||
// Target to apply ACL rule. Can be a subject's role class or a list of public
|
// Target to apply ACL rule. Can be a subject's role class or a list of public
|
||||||
// keys to match.
|
// keys to match.
|
||||||
message Target {
|
message Target {
|
||||||
// Target subject's role class
|
// Target subject's role class
|
||||||
Role role = 1 [json_name="role"];
|
Role role = 1 [ json_name = "role" ];
|
||||||
|
|
||||||
// List of public keys to identify target subject
|
// List of public keys to identify target subject
|
||||||
repeated bytes keys = 2 [json_name="keys"];
|
repeated bytes keys = 2 [ json_name = "keys" ];
|
||||||
}
|
}
|
||||||
// List of target subjects to apply ACL rule to
|
// List of target subjects to apply ACL rule to
|
||||||
repeated Target targets = 4 [json_name="targets"];
|
repeated Target targets = 4 [ json_name = "targets" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extended ACL rules table. A list of ACL rules defined additionally to Basic
|
// Extended ACL rules table. A list of ACL rules defined additionally to Basic
|
||||||
|
@ -167,13 +168,13 @@ message EACLRecord {
|
||||||
message EACLTable {
|
message EACLTable {
|
||||||
// eACL format version. Effectively, the version of API library used to create
|
// eACL format version. Effectively, the version of API library used to create
|
||||||
// eACL Table.
|
// eACL Table.
|
||||||
neo.fs.v2.refs.Version version = 1 [json_name = "version"];
|
neo.fs.v2.refs.Version version = 1 [ json_name = "version" ];
|
||||||
|
|
||||||
// Identifier of the container that should use given access control rules
|
// Identifier of the container that should use given access control rules
|
||||||
neo.fs.v2.refs.ContainerID container_id = 2 [json_name="containerID"];
|
neo.fs.v2.refs.ContainerID container_id = 2 [ json_name = "containerID" ];
|
||||||
|
|
||||||
// List of Extended ACL rules
|
// List of Extended ACL rules
|
||||||
repeated EACLRecord records = 3 [json_name="records"];
|
repeated EACLRecord records = 3 [ json_name = "records" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// BearerToken allows to attach signed Extended ACL rules to the request in
|
// BearerToken allows to attach signed Extended ACL rules to the request in
|
||||||
|
@ -183,44 +184,44 @@ message EACLTable {
|
||||||
// used in the similar use cases, like providing authorisation to externally
|
// used in the similar use cases, like providing authorisation to externally
|
||||||
// authenticated party.
|
// authenticated party.
|
||||||
//
|
//
|
||||||
// BearerToken can be issued only by the container's owner and must be signed using
|
// BearerToken can be issued only by the container's owner and must be signed
|
||||||
// the key associated with the container's `OwnerID`.
|
// using the key associated with the container's `OwnerID`.
|
||||||
message BearerToken {
|
message BearerToken {
|
||||||
// Bearer Token body structure contains Extended ACL table issued by the container
|
// Bearer Token body structure contains Extended ACL table issued by the
|
||||||
// owner with additional information preventing token abuse.
|
// container owner with additional information preventing token abuse.
|
||||||
message Body {
|
message Body {
|
||||||
// Table of Extended ACL rules to use instead of the ones attached to the
|
// Table of Extended ACL rules to use instead of the ones attached to the
|
||||||
// container. If it contains `container_id` field, bearer token is only
|
// container. If it contains `container_id` field, bearer token is only
|
||||||
// valid for this specific container. Otherwise, any container of the same owner
|
// valid for this specific container. Otherwise, any container of the same
|
||||||
// is allowed.
|
// owner is allowed.
|
||||||
EACLTable eacl_table = 1 [json_name="eaclTable"];
|
EACLTable eacl_table = 1 [ json_name = "eaclTable" ];
|
||||||
|
|
||||||
// `OwnerID` defines to whom the token was issued. It must match the request
|
// `OwnerID` defines to whom the token was issued. It must match the request
|
||||||
// originator's `OwnerID`. If empty, any token bearer will be accepted.
|
// originator's `OwnerID`. If empty, any token bearer will be accepted.
|
||||||
neo.fs.v2.refs.OwnerID owner_id = 2 [json_name="ownerID"];
|
neo.fs.v2.refs.OwnerID owner_id = 2 [ json_name = "ownerID" ];
|
||||||
|
|
||||||
// Lifetime parameters of the token. Field names taken from
|
// Lifetime parameters of the token. Field names taken from
|
||||||
// [rfc7519](https://tools.ietf.org/html/rfc7519).
|
// [rfc7519](https://tools.ietf.org/html/rfc7519).
|
||||||
message TokenLifetime {
|
message TokenLifetime {
|
||||||
// Expiration Epoch
|
// Expiration Epoch
|
||||||
uint64 exp = 1 [json_name="exp"];
|
uint64 exp = 1 [ json_name = "exp" ];
|
||||||
|
|
||||||
// Not valid before Epoch
|
// Not valid before Epoch
|
||||||
uint64 nbf = 2 [json_name="nbf"];
|
uint64 nbf = 2 [ json_name = "nbf" ];
|
||||||
|
|
||||||
// Issued at Epoch
|
// Issued at Epoch
|
||||||
uint64 iat = 3 [json_name="iat"];
|
uint64 iat = 3 [ json_name = "iat" ];
|
||||||
}
|
}
|
||||||
// Token expiration and valid time period parameters
|
// Token expiration and valid time period parameters
|
||||||
TokenLifetime lifetime = 3 [json_name="lifetime"];
|
TokenLifetime lifetime = 3 [ json_name = "lifetime" ];
|
||||||
|
|
||||||
// AllowImpersonate flag to consider token signer as request owner.
|
// AllowImpersonate flag to consider token signer as request owner.
|
||||||
// If this field is true extended ACL table in token body isn't processed.
|
// If this field is true extended ACL table in token body isn't processed.
|
||||||
bool allow_impersonate = 4 [json_name="allowImpersonate"];
|
bool allow_impersonate = 4 [ json_name = "allowImpersonate" ];
|
||||||
}
|
}
|
||||||
// Bearer Token body
|
// Bearer Token body
|
||||||
Body body = 1 [json_name="body"];
|
Body body = 1 [ json_name = "body" ];
|
||||||
|
|
||||||
// Signature of BearerToken body
|
// Signature of BearerToken body
|
||||||
neo.fs.v2.refs.Signature signature = 2 [json_name="signature"];
|
neo.fs.v2.refs.Signature signature = 2 [ json_name = "signature" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,48 +12,48 @@ import "refs/types.proto";
|
||||||
message DataAuditResult {
|
message DataAuditResult {
|
||||||
// Data Audit Result format version. Effectively, the version of API library
|
// Data Audit Result format version. Effectively, the version of API library
|
||||||
// used to report DataAuditResult structure.
|
// used to report DataAuditResult structure.
|
||||||
neo.fs.v2.refs.Version version = 1 [json_name = "version"];
|
neo.fs.v2.refs.Version version = 1 [ json_name = "version" ];
|
||||||
|
|
||||||
// Epoch number when the Data Audit was conducted
|
// Epoch number when the Data Audit was conducted
|
||||||
fixed64 audit_epoch = 2 [json_name = "auditEpoch"];
|
fixed64 audit_epoch = 2 [ json_name = "auditEpoch" ];
|
||||||
|
|
||||||
// Container under audit
|
// Container under audit
|
||||||
neo.fs.v2.refs.ContainerID container_id = 3 [json_name = "containerID"];
|
neo.fs.v2.refs.ContainerID container_id = 3 [ json_name = "containerID" ];
|
||||||
|
|
||||||
// Public key of the auditing InnerRing node in a binary format
|
// Public key of the auditing InnerRing node in a binary format
|
||||||
bytes public_key = 4 [json_name = "publicKey"];
|
bytes public_key = 4 [ json_name = "publicKey" ];
|
||||||
|
|
||||||
// Shows if Data Audit process was complete in time or if it was cancelled
|
// Shows if Data Audit process was complete in time or if it was cancelled
|
||||||
bool complete = 5 [json_name = "complete"];
|
bool complete = 5 [ json_name = "complete" ];
|
||||||
|
|
||||||
// Number of request done at PoR stage
|
// Number of request done at PoR stage
|
||||||
uint32 requests = 6 [json_name = "requests"];
|
uint32 requests = 6 [ json_name = "requests" ];
|
||||||
|
|
||||||
// Number of retries done at PoR stage
|
// Number of retries done at PoR stage
|
||||||
uint32 retries = 7 [json_name = "retries"];
|
uint32 retries = 7 [ json_name = "retries" ];
|
||||||
|
|
||||||
// List of Storage Groups that passed audit PoR stage
|
// List of Storage Groups that passed audit PoR stage
|
||||||
repeated neo.fs.v2.refs.ObjectID pass_sg = 8 [json_name = "passSG"];
|
repeated neo.fs.v2.refs.ObjectID pass_sg = 8 [ json_name = "passSG" ];
|
||||||
|
|
||||||
// List of Storage Groups that failed audit PoR stage
|
// List of Storage Groups that failed audit PoR stage
|
||||||
repeated neo.fs.v2.refs.ObjectID fail_sg = 9 [json_name = "failSG"];
|
repeated neo.fs.v2.refs.ObjectID fail_sg = 9 [ json_name = "failSG" ];
|
||||||
|
|
||||||
// Number of sampled objects under the audit placed in an optimal way according to
|
// Number of sampled objects under the audit placed in an optimal way
|
||||||
// the containers placement policy when checking PoP
|
// according to the containers placement policy when checking PoP
|
||||||
uint32 hit = 10 [json_name = "hit"];
|
uint32 hit = 10 [ json_name = "hit" ];
|
||||||
|
|
||||||
// Number of sampled objects under the audit placed in suboptimal way according to
|
// Number of sampled objects under the audit placed in suboptimal way
|
||||||
// the containers placement policy, but still at a satisfactory level when
|
// according to the containers placement policy, but still at a satisfactory
|
||||||
// checking PoP
|
// level when checking PoP
|
||||||
uint32 miss = 11 [json_name = "miss"];
|
uint32 miss = 11 [ json_name = "miss" ];
|
||||||
|
|
||||||
// Number of sampled objects under the audit stored inconsistently with the
|
// Number of sampled objects under the audit stored inconsistently with the
|
||||||
// placement policy or not found at all when checking PoP
|
// placement policy or not found at all when checking PoP
|
||||||
uint32 fail = 12 [json_name = "fail"];
|
uint32 fail = 12 [ json_name = "fail" ];
|
||||||
|
|
||||||
// List of storage node public keys that passed at least one PDP
|
// List of storage node public keys that passed at least one PDP
|
||||||
repeated bytes pass_nodes = 13 [json_name = "passNodes"];
|
repeated bytes pass_nodes = 13 [ json_name = "passNodes" ];
|
||||||
|
|
||||||
// List of storage node public keys that failed at least one PDP
|
// List of storage node public keys that failed at least one PDP
|
||||||
repeated bytes fail_nodes = 14 [json_name = "failNodes"];
|
repeated bytes fail_nodes = 14 [ json_name = "failNodes" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,8 @@ import "session/types.proto";
|
||||||
service ContainerService {
|
service ContainerService {
|
||||||
// `Put` invokes `Container` smart contract's `Put` method and returns
|
// `Put` invokes `Container` smart contract's `Put` method and returns
|
||||||
// response immediately. After a new block is issued in sidechain, request is
|
// response immediately. After a new block is issued in sidechain, request is
|
||||||
// verified by Inner Ring nodes. After one more block in sidechain, the container
|
// verified by Inner Ring nodes. After one more block in sidechain, the
|
||||||
// is added into smart contract storage.
|
// container is added into smart contract storage.
|
||||||
//
|
//
|
||||||
// Statuses:
|
// Statuses:
|
||||||
// - **OK** (0, SECTION_SUCCESS): \
|
// - **OK** (0, SECTION_SUCCESS): \
|
||||||
|
@ -28,8 +28,8 @@ service ContainerService {
|
||||||
|
|
||||||
// `Delete` invokes `Container` smart contract's `Delete` method and returns
|
// `Delete` invokes `Container` smart contract's `Delete` method and returns
|
||||||
// response immediately. After a new block is issued in sidechain, request is
|
// response immediately. After a new block is issued in sidechain, request is
|
||||||
// verified by Inner Ring nodes. After one more block in sidechain, the container
|
// verified by Inner Ring nodes. After one more block in sidechain, the
|
||||||
// is added into smart contract storage.
|
// container is added into smart contract storage.
|
||||||
//
|
//
|
||||||
// Statuses:
|
// Statuses:
|
||||||
// - **OK** (0, SECTION_SUCCESS): \
|
// - **OK** (0, SECTION_SUCCESS): \
|
||||||
|
@ -56,8 +56,8 @@ service ContainerService {
|
||||||
rpc List(ListRequest) returns (ListResponse);
|
rpc List(ListRequest) returns (ListResponse);
|
||||||
|
|
||||||
// Invokes 'SetEACL' method of 'Container` smart contract and returns response
|
// Invokes 'SetEACL' method of 'Container` smart contract and returns response
|
||||||
// immediately. After one more block in sidechain, changes in an Extended ACL are
|
// immediately. After one more block in sidechain, changes in an Extended ACL
|
||||||
// added into smart contract storage.
|
// are added into smart contract storage.
|
||||||
//
|
//
|
||||||
// Statuses:
|
// Statuses:
|
||||||
// - **OK** (0, SECTION_SUCCESS): \
|
// - **OK** (0, SECTION_SUCCESS): \
|
||||||
|
@ -84,7 +84,8 @@ service ContainerService {
|
||||||
// - **OK** (0, SECTION_SUCCESS): \
|
// - **OK** (0, SECTION_SUCCESS): \
|
||||||
// estimation of used space has been successfully announced;
|
// estimation of used space has been successfully announced;
|
||||||
// - Common failures (SECTION_FAILURE_COMMON).
|
// - Common failures (SECTION_FAILURE_COMMON).
|
||||||
rpc AnnounceUsedSpace(AnnounceUsedSpaceRequest) returns (AnnounceUsedSpaceResponse);
|
rpc AnnounceUsedSpace(AnnounceUsedSpaceRequest)
|
||||||
|
returns (AnnounceUsedSpaceResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
// New NeoFS Container creation request
|
// New NeoFS Container creation request
|
||||||
|
@ -146,7 +147,8 @@ message DeleteRequest {
|
||||||
// Identifier of the container to delete from NeoFS
|
// Identifier of the container to delete from NeoFS
|
||||||
neo.fs.v2.refs.ContainerID container_id = 1;
|
neo.fs.v2.refs.ContainerID container_id = 1;
|
||||||
|
|
||||||
// `ContainerID` signed with the container owner's key according to RFC-6979.
|
// `ContainerID` signed with the container owner's key according to
|
||||||
|
// RFC-6979.
|
||||||
neo.fs.v2.refs.SignatureRFC6979 signature = 2;
|
neo.fs.v2.refs.SignatureRFC6979 signature = 2;
|
||||||
}
|
}
|
||||||
// Body of container delete request message.
|
// Body of container delete request message.
|
||||||
|
@ -296,9 +298,9 @@ message SetExtendedACLRequest {
|
||||||
// Set Extended ACL
|
// Set Extended ACL
|
||||||
message SetExtendedACLResponse {
|
message SetExtendedACLResponse {
|
||||||
// `SetExtendedACLResponse` has an empty body because the operation is
|
// `SetExtendedACLResponse` has an empty body because the operation is
|
||||||
// asynchronous and the update should be reflected in `Container` smart contract's
|
// asynchronous and the update should be reflected in `Container` smart
|
||||||
// storage after next block is issued in sidechain.
|
// contract's storage after next block is issued in sidechain.
|
||||||
message Body { }
|
message Body {}
|
||||||
|
|
||||||
// Body of set extended acl response message.
|
// Body of set extended acl response message.
|
||||||
Body body = 1;
|
Body body = 1;
|
||||||
|
@ -337,8 +339,8 @@ message GetExtendedACLRequest {
|
||||||
// Get Extended ACL
|
// Get Extended ACL
|
||||||
message GetExtendedACLResponse {
|
message GetExtendedACLResponse {
|
||||||
// Get Extended ACL Response body can be empty if the requested container does
|
// Get Extended ACL Response body can be empty if the requested container does
|
||||||
// not have Extended ACL Table attached or Extended ACL has not been allowed at
|
// not have Extended ACL Table attached or Extended ACL has not been allowed
|
||||||
// the time of container creation.
|
// at the time of container creation.
|
||||||
message Body {
|
message Body {
|
||||||
// Extended ACL requested, if available
|
// Extended ACL requested, if available
|
||||||
neo.fs.v2.acl.EACLTable eacl = 1;
|
neo.fs.v2.acl.EACLTable eacl = 1;
|
||||||
|
@ -401,7 +403,7 @@ message AnnounceUsedSpaceRequest {
|
||||||
message AnnounceUsedSpaceResponse {
|
message AnnounceUsedSpaceResponse {
|
||||||
// `AnnounceUsedSpaceResponse` has an empty body because announcements are
|
// `AnnounceUsedSpaceResponse` has an empty body because announcements are
|
||||||
// one way communication.
|
// one way communication.
|
||||||
message Body { }
|
message Body {}
|
||||||
|
|
||||||
// Body of announce used space response message.
|
// Body of announce used space response message.
|
||||||
Body body = 1;
|
Body body = 1;
|
||||||
|
|
|
@ -10,26 +10,26 @@ import "refs/types.proto";
|
||||||
|
|
||||||
// Container is a structure that defines object placement behaviour. Objects can
|
// Container is a structure that defines object placement behaviour. Objects can
|
||||||
// be stored only within containers. They define placement rule, attributes and
|
// be stored only within containers. They define placement rule, attributes and
|
||||||
// access control information. An ID of a container is a 32 byte long SHA256 hash
|
// access control information. An ID of a container is a 32 byte long SHA256
|
||||||
// of stable-marshalled container message.
|
// hash of stable-marshalled container message.
|
||||||
message Container {
|
message Container {
|
||||||
// Container format version. Effectively, the version of API library used to
|
// Container format version. Effectively, the version of API library used to
|
||||||
// create the container.
|
// create the container.
|
||||||
neo.fs.v2.refs.Version version = 1 [json_name = "version"];
|
neo.fs.v2.refs.Version version = 1 [ json_name = "version" ];
|
||||||
|
|
||||||
// Identifier of the container owner
|
// Identifier of the container owner
|
||||||
neo.fs.v2.refs.OwnerID owner_id = 2 [json_name = "ownerID"];
|
neo.fs.v2.refs.OwnerID owner_id = 2 [ json_name = "ownerID" ];
|
||||||
|
|
||||||
// Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s
|
// Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s
|
||||||
bytes nonce = 3 [json_name = "nonce"];
|
bytes nonce = 3 [ json_name = "nonce" ];
|
||||||
|
|
||||||
// `BasicACL` contains access control rules for the owner, system and others groups,
|
// `BasicACL` contains access control rules for the owner, system and others
|
||||||
// as well as permission bits for `BearerToken` and `Extended ACL`
|
// groups, as well as permission bits for `BearerToken` and `Extended ACL`
|
||||||
uint32 basic_acl = 4 [json_name = "basicACL"];
|
uint32 basic_acl = 4 [ json_name = "basicACL" ];
|
||||||
|
|
||||||
// `Attribute` is a user-defined Key-Value metadata pair attached to the
|
// `Attribute` is a user-defined Key-Value metadata pair attached to the
|
||||||
// container. Container attributes are immutable. They are set at the moment of
|
// container. Container attributes are immutable. They are set at the moment
|
||||||
// container creation and can never be added or updated.
|
// of container creation and can never be added or updated.
|
||||||
//
|
//
|
||||||
// Key name must be a container-unique valid UTF-8 string. Value can't be
|
// Key name must be a container-unique valid UTF-8 string. Value can't be
|
||||||
// empty. Containers with duplicated attribute names or attributes with empty
|
// empty. Containers with duplicated attribute names or attributes with empty
|
||||||
|
@ -43,15 +43,16 @@ message Container {
|
||||||
// NNS contract.
|
// NNS contract.
|
||||||
// * [ __SYSTEM__ZONE ] \
|
// * [ __SYSTEM__ZONE ] \
|
||||||
// (`__NEOFS__ZONE` is deprecated) \
|
// (`__NEOFS__ZONE` is deprecated) \
|
||||||
// String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated). Used as a TLD of a domain name in NNS
|
// String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated).
|
||||||
// contract. If no zone is specified, use default zone: `container`.
|
// Used as a TLD of a domain name in NNS contract. If no zone is specified,
|
||||||
|
// use default zone: `container`.
|
||||||
// * [ __SYSTEM__DISABLE_HOMOMORPHIC_HASHING ] \
|
// * [ __SYSTEM__DISABLE_HOMOMORPHIC_HASHING ] \
|
||||||
// (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \
|
// (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \
|
||||||
// Disables homomorphic hashing for the container if the value equals "true" string.
|
// Disables homomorphic hashing for the container if the value equals "true"
|
||||||
// Any other values are interpreted as missing attribute. Container could be
|
// string. Any other values are interpreted as missing attribute. Container
|
||||||
// accepted in a NeoFS network only if the global network hashing configuration
|
// could be accepted in a NeoFS network only if the global network hashing
|
||||||
// value corresponds with that attribute's value. After container inclusion, network
|
// configuration value corresponds with that attribute's value. After
|
||||||
// setting is ignored.
|
// container inclusion, network setting is ignored.
|
||||||
//
|
//
|
||||||
// And some well-known attributes used by applications only:
|
// And some well-known attributes used by applications only:
|
||||||
//
|
//
|
||||||
|
@ -61,14 +62,15 @@ message Container {
|
||||||
// User-defined local time of container creation in Unix Timestamp format
|
// User-defined local time of container creation in Unix Timestamp format
|
||||||
message Attribute {
|
message Attribute {
|
||||||
// Attribute name key
|
// Attribute name key
|
||||||
string key = 1 [json_name = "key"];
|
string key = 1 [ json_name = "key" ];
|
||||||
|
|
||||||
// Attribute value
|
// Attribute value
|
||||||
string value = 2 [json_name = "value"];
|
string value = 2 [ json_name = "value" ];
|
||||||
}
|
}
|
||||||
// Attributes represent immutable container's meta data
|
// Attributes represent immutable container's meta data
|
||||||
repeated Attribute attributes = 5 [json_name = "attributes"];
|
repeated Attribute attributes = 5 [ json_name = "attributes" ];
|
||||||
|
|
||||||
// Placement policy for the object inside the container
|
// Placement policy for the object inside the container
|
||||||
neo.fs.v2.netmap.PlacementPolicy placement_policy = 6 [json_name = "placementPolicy"];
|
neo.fs.v2.netmap.PlacementPolicy placement_policy = 6
|
||||||
|
[ json_name = "placementPolicy" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,10 +9,11 @@ import "refs/types.proto";
|
||||||
|
|
||||||
// Lock objects protects a list of objects from being deleted. The lifetime of a
|
// Lock objects protects a list of objects from being deleted. The lifetime of a
|
||||||
// lock object is limited similar to regular objects in
|
// lock object is limited similar to regular objects in
|
||||||
// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) attribute. Lock object MUST have expiration epoch.
|
// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated)
|
||||||
// It is impossible to delete a lock object via ObjectService.Delete RPC call.
|
// attribute. Lock object MUST have expiration epoch. It is impossible to delete
|
||||||
|
// a lock object via ObjectService.Delete RPC call.
|
||||||
message Lock {
|
message Lock {
|
||||||
// List of objects to lock. Must not be empty or carry empty IDs.
|
// List of objects to lock. Must not be empty or carry empty IDs.
|
||||||
// All members must be of the `REGULAR` type.
|
// All members must be of the `REGULAR` type.
|
||||||
repeated neo.fs.v2.refs.ObjectID members = 1 [json_name = "members"];
|
repeated neo.fs.v2.refs.ObjectID members = 1 [ json_name = "members" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,22 +9,23 @@ import "netmap/types.proto";
|
||||||
import "refs/types.proto";
|
import "refs/types.proto";
|
||||||
import "session/types.proto";
|
import "session/types.proto";
|
||||||
|
|
||||||
// `NetmapService` provides methods to work with `Network Map` and the information
|
// `NetmapService` provides methods to work with `Network Map` and the
|
||||||
// required to build it. The resulting `Network Map` is stored in sidechain
|
// information required to build it. The resulting `Network Map` is stored in
|
||||||
// `Netmap` smart contract, while related information can be obtained from other
|
// sidechain `Netmap` smart contract, while related information can be obtained
|
||||||
// NeoFS nodes.
|
// from other NeoFS nodes.
|
||||||
service NetmapService {
|
service NetmapService {
|
||||||
// Get NodeInfo structure from the particular node directly.
|
// Get NodeInfo structure from the particular node directly.
|
||||||
// Node information can be taken from `Netmap` smart contract. In some cases, though,
|
// Node information can be taken from `Netmap` smart contract. In some cases,
|
||||||
// one may want to get recent information directly or to talk to the node not yet
|
// though, one may want to get recent information directly or to talk to the
|
||||||
// present in the `Network Map` to find out what API version can be used for
|
// node not yet present in the `Network Map` to find out what API version can
|
||||||
// further communication. This can be also used to check if a node is up and running.
|
// be used for further communication. This can be also used to check if a node
|
||||||
|
// is up and running.
|
||||||
//
|
//
|
||||||
// Statuses:
|
// Statuses:
|
||||||
// - **OK** (0, SECTION_SUCCESS):
|
// - **OK** (0, SECTION_SUCCESS):
|
||||||
// information about the server has been successfully read;
|
// information about the server has been successfully read;
|
||||||
// - Common failures (SECTION_FAILURE_COMMON).
|
// - Common failures (SECTION_FAILURE_COMMON).
|
||||||
rpc LocalNodeInfo (LocalNodeInfoRequest) returns (LocalNodeInfoResponse);
|
rpc LocalNodeInfo(LocalNodeInfoRequest) returns (LocalNodeInfoResponse);
|
||||||
|
|
||||||
// Read recent information about the NeoFS network.
|
// Read recent information about the NeoFS network.
|
||||||
//
|
//
|
||||||
|
@ -32,7 +33,7 @@ service NetmapService {
|
||||||
// - **OK** (0, SECTION_SUCCESS):
|
// - **OK** (0, SECTION_SUCCESS):
|
||||||
// information about the current network state has been successfully read;
|
// information about the current network state has been successfully read;
|
||||||
// - Common failures (SECTION_FAILURE_COMMON).
|
// - Common failures (SECTION_FAILURE_COMMON).
|
||||||
rpc NetworkInfo (NetworkInfoRequest) returns (NetworkInfoResponse);
|
rpc NetworkInfo(NetworkInfoRequest) returns (NetworkInfoResponse);
|
||||||
|
|
||||||
// Returns network map snapshot of the current NeoFS epoch.
|
// Returns network map snapshot of the current NeoFS epoch.
|
||||||
//
|
//
|
||||||
|
@ -40,14 +41,13 @@ service NetmapService {
|
||||||
// - **OK** (0, SECTION_SUCCESS):
|
// - **OK** (0, SECTION_SUCCESS):
|
||||||
// information about the current network map has been successfully read;
|
// information about the current network map has been successfully read;
|
||||||
// - Common failures (SECTION_FAILURE_COMMON).
|
// - Common failures (SECTION_FAILURE_COMMON).
|
||||||
rpc NetmapSnapshot (NetmapSnapshotRequest) returns (NetmapSnapshotResponse);
|
rpc NetmapSnapshot(NetmapSnapshotRequest) returns (NetmapSnapshotResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get NodeInfo structure directly from a particular node
|
// Get NodeInfo structure directly from a particular node
|
||||||
message LocalNodeInfoRequest {
|
message LocalNodeInfoRequest {
|
||||||
// LocalNodeInfo request body is empty.
|
// LocalNodeInfo request body is empty.
|
||||||
message Body {
|
message Body {}
|
||||||
}
|
|
||||||
// Body of the LocalNodeInfo request message
|
// Body of the LocalNodeInfo request message
|
||||||
Body body = 1;
|
Body body = 1;
|
||||||
|
|
||||||
|
@ -86,81 +86,77 @@ message LocalNodeInfoResponse {
|
||||||
|
|
||||||
// Get NetworkInfo structure with the network view from a particular node.
|
// Get NetworkInfo structure with the network view from a particular node.
|
||||||
message NetworkInfoRequest {
|
message NetworkInfoRequest {
|
||||||
// NetworkInfo request body is empty.
|
// NetworkInfo request body is empty.
|
||||||
message Body {
|
message Body {}
|
||||||
}
|
// Body of the NetworkInfo request message
|
||||||
// Body of the NetworkInfo request message
|
Body body = 1;
|
||||||
Body body = 1;
|
|
||||||
|
|
||||||
// Carries request meta information. Header data is used only to regulate
|
// Carries request meta information. Header data is used only to regulate
|
||||||
// message transport and does not affect request execution.
|
// message transport and does not affect request execution.
|
||||||
neo.fs.v2.session.RequestMetaHeader meta_header = 2;
|
neo.fs.v2.session.RequestMetaHeader meta_header = 2;
|
||||||
|
|
||||||
// Carries request verification information. This header is used to
|
// Carries request verification information. This header is used to
|
||||||
// authenticate the nodes of the message route and check the correctness of
|
// authenticate the nodes of the message route and check the correctness of
|
||||||
// transmission.
|
// transmission.
|
||||||
neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
|
neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Response with NetworkInfo structure including current epoch and
|
// Response with NetworkInfo structure including current epoch and
|
||||||
// sidechain magic number.
|
// sidechain magic number.
|
||||||
message NetworkInfoResponse {
|
message NetworkInfoResponse {
|
||||||
// Information about the network.
|
// Information about the network.
|
||||||
message Body {
|
message Body {
|
||||||
// NetworkInfo structure with recent information.
|
// NetworkInfo structure with recent information.
|
||||||
NetworkInfo network_info = 1;
|
NetworkInfo network_info = 1;
|
||||||
}
|
}
|
||||||
// Body of the NetworkInfo response message.
|
// Body of the NetworkInfo response message.
|
||||||
Body body = 1;
|
Body body = 1;
|
||||||
|
|
||||||
// Carries response meta information. Header data is used only to regulate
|
// Carries response meta information. Header data is used only to regulate
|
||||||
// message transport and does not affect response execution.
|
// message transport and does not affect response execution.
|
||||||
neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
|
neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
|
||||||
|
|
||||||
// Carries response verification information. This header is used to
|
// Carries response verification information. This header is used to
|
||||||
// authenticate the nodes of the message route and check the correctness of
|
// authenticate the nodes of the message route and check the correctness of
|
||||||
// transmission.
|
// transmission.
|
||||||
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
|
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get netmap snapshot request
|
// Get netmap snapshot request
|
||||||
message NetmapSnapshotRequest {
|
message NetmapSnapshotRequest {
|
||||||
// Get netmap snapshot request body.
|
// Get netmap snapshot request body.
|
||||||
message Body {
|
message Body {}
|
||||||
}
|
|
||||||
|
|
||||||
// Body of get netmap snapshot request message.
|
// Body of get netmap snapshot request message.
|
||||||
Body body = 1;
|
Body body = 1;
|
||||||
|
|
||||||
// Carries request meta information. Header data is used only to regulate
|
// Carries request meta information. Header data is used only to regulate
|
||||||
// message transport and does not affect request execution.
|
// message transport and does not affect request execution.
|
||||||
neo.fs.v2.session.RequestMetaHeader meta_header = 2;
|
neo.fs.v2.session.RequestMetaHeader meta_header = 2;
|
||||||
|
|
||||||
// Carries request verification information. This header is used to
|
|
||||||
// authenticate the nodes of the message route and check the correctness of
|
|
||||||
// transmission.
|
|
||||||
neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
|
|
||||||
|
|
||||||
|
// Carries request verification information. This header is used to
|
||||||
|
// authenticate the nodes of the message route and check the correctness of
|
||||||
|
// transmission.
|
||||||
|
neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Response with current netmap snapshot
|
// Response with current netmap snapshot
|
||||||
message NetmapSnapshotResponse {
|
message NetmapSnapshotResponse {
|
||||||
// Get netmap snapshot response body
|
// Get netmap snapshot response body
|
||||||
message Body {
|
message Body {
|
||||||
// Structure of the requested network map.
|
// Structure of the requested network map.
|
||||||
Netmap netmap = 1 [json_name = "netmap"];
|
Netmap netmap = 1 [ json_name = "netmap" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Body of get netmap snapshot response message.
|
// Body of get netmap snapshot response message.
|
||||||
Body body = 1;
|
Body body = 1;
|
||||||
|
|
||||||
// Carries response meta information. Header data is used only to regulate
|
// Carries response meta information. Header data is used only to regulate
|
||||||
// message transport and does not affect response execution.
|
// message transport and does not affect response execution.
|
||||||
neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
|
neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
|
||||||
|
|
||||||
// Carries response verification information. This header is used to
|
|
||||||
// authenticate the nodes of the message route and check the correctness of
|
|
||||||
// transmission.
|
|
||||||
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
|
|
||||||
|
|
||||||
|
// Carries response verification information. This header is used to
|
||||||
|
// authenticate the nodes of the message route and check the correctness of
|
||||||
|
// transmission.
|
||||||
|
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,46 +52,46 @@ enum Clause {
|
||||||
DISTINCT = 2;
|
DISTINCT = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This filter will return the subset of nodes from `NetworkMap` or another filter's
|
// This filter will return the subset of nodes from `NetworkMap` or another
|
||||||
// results that will satisfy filter's conditions.
|
// filter's results that will satisfy filter's conditions.
|
||||||
message Filter {
|
message Filter {
|
||||||
// Name of the filter or a reference to a named filter. '*' means
|
// Name of the filter or a reference to a named filter. '*' means
|
||||||
// application to the whole unfiltered NetworkMap. At top level it's used as a
|
// application to the whole unfiltered NetworkMap. At top level it's used as a
|
||||||
// filter name. At lower levels it's considered to be a reference to another
|
// filter name. At lower levels it's considered to be a reference to another
|
||||||
// named filter
|
// named filter
|
||||||
string name = 1 [json_name = "name"];
|
string name = 1 [ json_name = "name" ];
|
||||||
|
|
||||||
// Key to filter
|
// Key to filter
|
||||||
string key = 2 [json_name = "key"];
|
string key = 2 [ json_name = "key" ];
|
||||||
|
|
||||||
// Filtering operation
|
// Filtering operation
|
||||||
Operation op = 3 [json_name = "op"];
|
Operation op = 3 [ json_name = "op" ];
|
||||||
|
|
||||||
// Value to match
|
// Value to match
|
||||||
string value = 4 [json_name = "value"];
|
string value = 4 [ json_name = "value" ];
|
||||||
|
|
||||||
// List of inner filters. Top level operation will be applied to the whole
|
// List of inner filters. Top level operation will be applied to the whole
|
||||||
// list.
|
// list.
|
||||||
repeated Filter filters = 5 [json_name = "filters"];
|
repeated Filter filters = 5 [ json_name = "filters" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Selector chooses a number of nodes from the bucket taking the nearest nodes
|
// Selector chooses a number of nodes from the bucket taking the nearest nodes
|
||||||
// to the provided `ContainerID` by hash distance.
|
// to the provided `ContainerID` by hash distance.
|
||||||
message Selector {
|
message Selector {
|
||||||
// Selector name to reference in object placement section
|
// Selector name to reference in object placement section
|
||||||
string name = 1 [json_name = "name"];
|
string name = 1 [ json_name = "name" ];
|
||||||
|
|
||||||
// How many nodes to select from the bucket
|
// How many nodes to select from the bucket
|
||||||
uint32 count = 2 [json_name = "count"];
|
uint32 count = 2 [ json_name = "count" ];
|
||||||
|
|
||||||
// Selector modifier showing how to form a bucket
|
// Selector modifier showing how to form a bucket
|
||||||
Clause clause = 3 [json_name = "clause"];
|
Clause clause = 3 [ json_name = "clause" ];
|
||||||
|
|
||||||
// Bucket attribute to select from
|
// Bucket attribute to select from
|
||||||
string attribute = 4 [json_name = "attribute"];
|
string attribute = 4 [ json_name = "attribute" ];
|
||||||
|
|
||||||
// Filter reference to select from
|
// Filter reference to select from
|
||||||
string filter = 5 [json_name = "filter"];
|
string filter = 5 [ json_name = "filter" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number of object replicas in a set of nodes from the defined selector. If no
|
// Number of object replicas in a set of nodes from the defined selector. If no
|
||||||
|
@ -99,10 +99,10 @@ message Selector {
|
||||||
// default.
|
// default.
|
||||||
message Replica {
|
message Replica {
|
||||||
// How many object replicas to put
|
// How many object replicas to put
|
||||||
uint32 count = 1 [json_name = "count"];
|
uint32 count = 1 [ json_name = "count" ];
|
||||||
|
|
||||||
// Named selector bucket to put replicas
|
// Named selector bucket to put replicas
|
||||||
string selector = 2 [json_name = "selector"];
|
string selector = 2 [ json_name = "selector" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set of rules to select a subset of nodes from `NetworkMap` able to store
|
// Set of rules to select a subset of nodes from `NetworkMap` able to store
|
||||||
|
@ -111,29 +111,29 @@ message Replica {
|
||||||
message PlacementPolicy {
|
message PlacementPolicy {
|
||||||
// Rules to set number of object replicas and place each one into a named
|
// Rules to set number of object replicas and place each one into a named
|
||||||
// bucket
|
// bucket
|
||||||
repeated Replica replicas = 1 [json_name = "replicas"];
|
repeated Replica replicas = 1 [ json_name = "replicas" ];
|
||||||
|
|
||||||
// Container backup factor controls how deep NeoFS will search for nodes
|
// Container backup factor controls how deep NeoFS will search for nodes
|
||||||
// alternatives to include into container's nodes subset
|
// alternatives to include into container's nodes subset
|
||||||
uint32 container_backup_factor = 2 [json_name = "containerBackupFactor"];
|
uint32 container_backup_factor = 2 [ json_name = "containerBackupFactor" ];
|
||||||
|
|
||||||
// Set of Selectors to form the container's nodes subset
|
// Set of Selectors to form the container's nodes subset
|
||||||
repeated Selector selectors = 3 [json_name = "selectors"];
|
repeated Selector selectors = 3 [ json_name = "selectors" ];
|
||||||
|
|
||||||
// List of named filters to reference in selectors
|
// List of named filters to reference in selectors
|
||||||
repeated Filter filters = 4 [json_name = "filters"];
|
repeated Filter filters = 4 [ json_name = "filters" ];
|
||||||
|
|
||||||
// Unique flag defines non-overlapping application for replicas
|
// Unique flag defines non-overlapping application for replicas
|
||||||
bool unique = 5 [json_name = "unique"];
|
bool unique = 5 [ json_name = "unique" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// NeoFS node description
|
// NeoFS node description
|
||||||
message NodeInfo {
|
message NodeInfo {
|
||||||
// Public key of the NeoFS node in a binary format
|
// Public key of the NeoFS node in a binary format
|
||||||
bytes public_key = 1 [json_name = "publicKey"];
|
bytes public_key = 1 [ json_name = "publicKey" ];
|
||||||
|
|
||||||
// Ways to connect to a node
|
// Ways to connect to a node
|
||||||
repeated string addresses = 2 [json_name = "addresses"];
|
repeated string addresses = 2 [ json_name = "addresses" ];
|
||||||
|
|
||||||
// Administrator-defined Attributes of the NeoFS Storage Node.
|
// Administrator-defined Attributes of the NeoFS Storage Node.
|
||||||
//
|
//
|
||||||
|
@ -141,15 +141,15 @@ message NodeInfo {
|
||||||
// string. Value can't be empty.
|
// string. Value can't be empty.
|
||||||
//
|
//
|
||||||
// Attributes can be constructed into a chain of attributes: any attribute can
|
// Attributes can be constructed into a chain of attributes: any attribute can
|
||||||
// have a parent attribute and a child attribute (except the first and the last
|
// have a parent attribute and a child attribute (except the first and the
|
||||||
// one). A string representation of the chain of attributes in NeoFS Storage
|
// last one). A string representation of the chain of attributes in NeoFS
|
||||||
// Node configuration uses ":" and "/" symbols, e.g.:
|
// Storage Node configuration uses ":" and "/" symbols, e.g.:
|
||||||
//
|
//
|
||||||
// `NEOFS_NODE_ATTRIBUTE_1=key1:val1/key2:val2`
|
// `NEOFS_NODE_ATTRIBUTE_1=key1:val1/key2:val2`
|
||||||
//
|
//
|
||||||
// Therefore the string attribute representation in the Node configuration must
|
// Therefore the string attribute representation in the Node configuration
|
||||||
// use "\:", "\/" and "\\" escaped symbols if any of them appears in an attribute's
|
// must use "\:", "\/" and "\\" escaped symbols if any of them appears in an
|
||||||
// key or value.
|
// attribute's key or value.
|
||||||
//
|
//
|
||||||
// Node's attributes are mostly used during Storage Policy evaluation to
|
// Node's attributes are mostly used during Storage Policy evaluation to
|
||||||
// calculate object's placement and find a set of nodes satisfying policy
|
// calculate object's placement and find a set of nodes satisfying policy
|
||||||
|
@ -204,20 +204,20 @@ message NodeInfo {
|
||||||
// corresponding section in NeoFS Technical Specification.
|
// corresponding section in NeoFS Technical Specification.
|
||||||
message Attribute {
|
message Attribute {
|
||||||
// Key of the node attribute
|
// Key of the node attribute
|
||||||
string key = 1 [json_name = "key"];
|
string key = 1 [ json_name = "key" ];
|
||||||
|
|
||||||
// Value of the node attribute
|
// Value of the node attribute
|
||||||
string value = 2 [json_name = "value"];
|
string value = 2 [ json_name = "value" ];
|
||||||
|
|
||||||
// Parent keys, if any. For example for `City` it could be `Region` and
|
// Parent keys, if any. For example for `City` it could be `Region` and
|
||||||
// `Country`.
|
// `Country`.
|
||||||
repeated string parents = 3 [json_name = "parents"];
|
repeated string parents = 3 [ json_name = "parents" ];
|
||||||
}
|
}
|
||||||
// Carries list of the NeoFS node attributes in a key-value form. Key name
|
// Carries list of the NeoFS node attributes in a key-value form. Key name
|
||||||
// must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo
|
// must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo
|
||||||
// structures with duplicated attribute names or attributes with empty values
|
// structures with duplicated attribute names or attributes with empty values
|
||||||
// will be considered invalid.
|
// will be considered invalid.
|
||||||
repeated Attribute attributes = 3 [json_name = "attributes"];
|
repeated Attribute attributes = 3 [ json_name = "attributes" ];
|
||||||
|
|
||||||
// Represents the enumeration of various states of the NeoFS node.
|
// Represents the enumeration of various states of the NeoFS node.
|
||||||
enum State {
|
enum State {
|
||||||
|
@ -235,16 +235,16 @@ message NodeInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Carries state of the NeoFS node
|
// Carries state of the NeoFS node
|
||||||
State state = 4 [json_name = "state"];
|
State state = 4 [ json_name = "state" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Network map structure
|
// Network map structure
|
||||||
message Netmap {
|
message Netmap {
|
||||||
// Network map revision number.
|
// Network map revision number.
|
||||||
uint64 epoch = 1 [json_name = "epoch"];
|
uint64 epoch = 1 [ json_name = "epoch" ];
|
||||||
|
|
||||||
// Nodes presented in network.
|
// Nodes presented in network.
|
||||||
repeated NodeInfo nodes = 2 [json_name = "nodes"];
|
repeated NodeInfo nodes = 2 [ json_name = "nodes" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// NeoFS network configuration
|
// NeoFS network configuration
|
||||||
|
@ -285,26 +285,27 @@ message NetworkConfig {
|
||||||
// Value: little-endian integer. Default: 0.
|
// Value: little-endian integer. Default: 0.
|
||||||
message Parameter {
|
message Parameter {
|
||||||
// Parameter key. UTF-8 encoded string
|
// Parameter key. UTF-8 encoded string
|
||||||
bytes key = 1 [json_name = "key"];
|
bytes key = 1 [ json_name = "key" ];
|
||||||
|
|
||||||
// Parameter value
|
// Parameter value
|
||||||
bytes value = 2 [json_name = "value"];
|
bytes value = 2 [ json_name = "value" ];
|
||||||
}
|
}
|
||||||
// List of parameter values
|
// List of parameter values
|
||||||
repeated Parameter parameters = 1 [json_name = "parameters"];
|
repeated Parameter parameters = 1 [ json_name = "parameters" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Information about NeoFS network
|
// Information about NeoFS network
|
||||||
message NetworkInfo {
|
message NetworkInfo {
|
||||||
// Number of the current epoch in the NeoFS network
|
// Number of the current epoch in the NeoFS network
|
||||||
uint64 current_epoch = 1 [json_name = "currentEpoch"];
|
uint64 current_epoch = 1 [ json_name = "currentEpoch" ];
|
||||||
|
|
||||||
// Magic number of the sidechain of the NeoFS network
|
// Magic number of the sidechain of the NeoFS network
|
||||||
uint64 magic_number = 2 [json_name = "magicNumber"];
|
uint64 magic_number = 2 [ json_name = "magicNumber" ];
|
||||||
|
|
||||||
// MillisecondsPerBlock network parameter of the sidechain of the NeoFS network
|
// MillisecondsPerBlock network parameter of the sidechain of the NeoFS
|
||||||
int64 ms_per_block = 3 [json_name = "msPerBlock"];
|
// network
|
||||||
|
int64 ms_per_block = 3 [ json_name = "msPerBlock" ];
|
||||||
|
|
||||||
// NeoFS network configuration
|
// NeoFS network configuration
|
||||||
NetworkConfig network_config = 4 [json_name = "networkConfig"];
|
NetworkConfig network_config = 4 [ json_name = "networkConfig" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,9 +11,9 @@ option csharp_namespace = "Neo.FileStorage.API.Refs";
|
||||||
// `ContainerID` and `ObjectID` delimited by '/' character.
|
// `ContainerID` and `ObjectID` delimited by '/' character.
|
||||||
message Address {
|
message Address {
|
||||||
// Container identifier
|
// Container identifier
|
||||||
ContainerID container_id = 1 [json_name = "containerID"];
|
ContainerID container_id = 1 [ json_name = "containerID" ];
|
||||||
// Object identifier
|
// Object identifier
|
||||||
ObjectID object_id = 2 [json_name = "objectID"];
|
ObjectID object_id = 2 [ json_name = "objectID" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// NeoFS Object unique identifier. Objects are immutable and content-addressed.
|
// NeoFS Object unique identifier. Objects are immutable and content-addressed.
|
||||||
|
@ -21,8 +21,8 @@ message Address {
|
||||||
//
|
//
|
||||||
// `ObjectID` is a 32 byte long
|
// `ObjectID` is a 32 byte long
|
||||||
// [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of
|
// [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of
|
||||||
// the object's `header` field, which, in it's turn, contains the hash of the object's
|
// the object's `header` field, which, in it's turn, contains the hash of the
|
||||||
// payload.
|
// object's payload.
|
||||||
//
|
//
|
||||||
// String presentation is a
|
// String presentation is a
|
||||||
// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string.
|
// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string.
|
||||||
|
@ -34,7 +34,7 @@ message Address {
|
||||||
// with/without paddings are accepted.
|
// with/without paddings are accepted.
|
||||||
message ObjectID {
|
message ObjectID {
|
||||||
// Object identifier in a binary format
|
// Object identifier in a binary format
|
||||||
bytes value = 1 [json_name = "value"];
|
bytes value = 1 [ json_name = "value" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// NeoFS container identifier. Container structures are immutable and
|
// NeoFS container identifier. Container structures are immutable and
|
||||||
|
@ -54,7 +54,7 @@ message ObjectID {
|
||||||
// with/without paddings are accepted.
|
// with/without paddings are accepted.
|
||||||
message ContainerID {
|
message ContainerID {
|
||||||
// Container identifier in a binary format.
|
// Container identifier in a binary format.
|
||||||
bytes value = 1 [json_name = "value"];
|
bytes value = 1 [ json_name = "value" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// `OwnerID` is a derivative of a user's main public key. The transformation
|
// `OwnerID` is a derivative of a user's main public key. The transformation
|
||||||
|
@ -74,32 +74,34 @@ message ContainerID {
|
||||||
// with/without paddings are accepted.
|
// with/without paddings are accepted.
|
||||||
message OwnerID {
|
message OwnerID {
|
||||||
// Identifier of the container owner in a binary format
|
// Identifier of the container owner in a binary format
|
||||||
bytes value = 1 [json_name = "value"];
|
bytes value = 1 [ json_name = "value" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// API version used by a node.
|
// API version used by a node.
|
||||||
//
|
//
|
||||||
// String presentation is a Semantic Versioning 2.0.0 compatible version string
|
// String presentation is a Semantic Versioning 2.0.0 compatible version string
|
||||||
// with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the minor number.
|
// with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the minor
|
||||||
|
// number.
|
||||||
message Version {
|
message Version {
|
||||||
// Major API version
|
// Major API version
|
||||||
uint32 major = 1 [json_name = "major"];
|
uint32 major = 1 [ json_name = "major" ];
|
||||||
|
|
||||||
// Minor API version
|
// Minor API version
|
||||||
uint32 minor = 2 [json_name = "minor"];
|
uint32 minor = 2 [ json_name = "minor" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Signature of something in NeoFS.
|
// Signature of something in NeoFS.
|
||||||
message Signature {
|
message Signature {
|
||||||
// Public key used for signing
|
// Public key used for signing
|
||||||
bytes key = 1 [json_name = "key"];
|
bytes key = 1 [ json_name = "key" ];
|
||||||
// Signature
|
// Signature
|
||||||
bytes sign = 2 [json_name = "signature"];
|
bytes sign = 2 [ json_name = "signature" ];
|
||||||
// Scheme contains digital signature scheme identifier
|
// Scheme contains digital signature scheme identifier
|
||||||
SignatureScheme scheme = 3 [json_name = "scheme"];
|
SignatureScheme scheme = 3 [ json_name = "scheme" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Signature scheme describes digital signing scheme used for (key, signature) pair.
|
// Signature scheme describes digital signing scheme used for (key, signature)
|
||||||
|
// pair.
|
||||||
enum SignatureScheme {
|
enum SignatureScheme {
|
||||||
// ECDSA with SHA-512 hashing (FIPS 186-3)
|
// ECDSA with SHA-512 hashing (FIPS 186-3)
|
||||||
ECDSA_SHA512 = 0;
|
ECDSA_SHA512 = 0;
|
||||||
|
@ -115,9 +117,9 @@ enum SignatureScheme {
|
||||||
// RFC 6979 signature.
|
// RFC 6979 signature.
|
||||||
message SignatureRFC6979 {
|
message SignatureRFC6979 {
|
||||||
// Public key used for signing
|
// Public key used for signing
|
||||||
bytes key = 1 [json_name = "key"];
|
bytes key = 1 [ json_name = "key" ];
|
||||||
// Deterministic ECDSA with SHA-256 hashing
|
// Deterministic ECDSA with SHA-256 hashing
|
||||||
bytes sign = 2 [json_name = "signature"];
|
bytes sign = 2 [ json_name = "signature" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checksum algorithm type.
|
// Checksum algorithm type.
|
||||||
|
@ -141,8 +143,8 @@ enum ChecksumType {
|
||||||
// Hex encoded string without `0x` prefix
|
// Hex encoded string without `0x` prefix
|
||||||
message Checksum {
|
message Checksum {
|
||||||
// Checksum algorithm type
|
// Checksum algorithm type
|
||||||
ChecksumType type = 1 [json_name = "type"];
|
ChecksumType type = 1 [ json_name = "type" ];
|
||||||
|
|
||||||
// Checksum itself
|
// Checksum itself
|
||||||
bytes sum = 2 [json_name = "sum"];
|
bytes sum = 2 [ json_name = "sum" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ service SessionService {
|
||||||
// - **OK** (0, SECTION_SUCCESS):
|
// - **OK** (0, SECTION_SUCCESS):
|
||||||
// session has been successfully opened;
|
// session has been successfully opened;
|
||||||
// - Common failures (SECTION_FAILURE_COMMON).
|
// - Common failures (SECTION_FAILURE_COMMON).
|
||||||
rpc Create (CreateRequest) returns (CreateResponse);
|
rpc Create(CreateRequest) returns (CreateResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Information necessary for opening a session.
|
// Information necessary for opening a session.
|
||||||
|
|
|
@ -38,51 +38,51 @@ message ObjectSessionContext {
|
||||||
RANGEHASH = 7;
|
RANGEHASH = 7;
|
||||||
}
|
}
|
||||||
// Type of request for which the token is issued
|
// Type of request for which the token is issued
|
||||||
Verb verb = 1 [json_name = "verb"];
|
Verb verb = 1 [ json_name = "verb" ];
|
||||||
|
|
||||||
// Carries objects involved in the object session.
|
// Carries objects involved in the object session.
|
||||||
message Target {
|
message Target {
|
||||||
// Indicates which container the session is spread to. Field MUST be set
|
// Indicates which container the session is spread to. Field MUST be set
|
||||||
// and correct.
|
// and correct.
|
||||||
refs.ContainerID container = 1 [json_name = "container"];
|
refs.ContainerID container = 1 [ json_name = "container" ];
|
||||||
|
|
||||||
// Indicates which objects the session is spread to. Objects are expected
|
// Indicates which objects the session is spread to. Objects are expected
|
||||||
// to be stored in the NeoFS container referenced by `container` field.
|
// to be stored in the NeoFS container referenced by `container` field.
|
||||||
// Each element MUST have correct format.
|
// Each element MUST have correct format.
|
||||||
repeated refs.ObjectID objects = 2 [json_name = "objects"];
|
repeated refs.ObjectID objects = 2 [ json_name = "objects" ];
|
||||||
}
|
}
|
||||||
// Object session target. MUST be correctly formed and set. If `objects`
|
// Object session target. MUST be correctly formed and set. If `objects`
|
||||||
// field is not empty, then the session applies only to these elements,
|
// field is not empty, then the session applies only to these elements,
|
||||||
// otherwise, to all objects from the specified container.
|
// otherwise, to all objects from the specified container.
|
||||||
Target target = 2 [json_name = "target"];
|
Target target = 2 [ json_name = "target" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Context information for Session Tokens related to ContainerService requests.
|
// Context information for Session Tokens related to ContainerService requests.
|
||||||
message ContainerSessionContext {
|
message ContainerSessionContext {
|
||||||
// Container request verbs
|
// Container request verbs
|
||||||
enum Verb {
|
enum Verb {
|
||||||
// Unknown verb
|
// Unknown verb
|
||||||
VERB_UNSPECIFIED = 0;
|
VERB_UNSPECIFIED = 0;
|
||||||
|
|
||||||
// Refers to container.Put RPC call
|
// Refers to container.Put RPC call
|
||||||
PUT = 1;
|
PUT = 1;
|
||||||
|
|
||||||
// Refers to container.Delete RPC call
|
// Refers to container.Delete RPC call
|
||||||
DELETE = 2;
|
DELETE = 2;
|
||||||
|
|
||||||
// Refers to container.SetExtendedACL RPC call
|
// Refers to container.SetExtendedACL RPC call
|
||||||
SETEACL = 3;
|
SETEACL = 3;
|
||||||
}
|
}
|
||||||
// Type of request for which the token is issued
|
// Type of request for which the token is issued
|
||||||
Verb verb = 1 [json_name = "verb"];
|
Verb verb = 1 [ json_name = "verb" ];
|
||||||
|
|
||||||
// Spreads the action to all owner containers.
|
// Spreads the action to all owner containers.
|
||||||
// If set, container_id field is ignored.
|
// If set, container_id field is ignored.
|
||||||
bool wildcard = 2 [json_name = "wildcard"];
|
bool wildcard = 2 [ json_name = "wildcard" ];
|
||||||
|
|
||||||
// Particular container to which the action applies.
|
// Particular container to which the action applies.
|
||||||
// Ignored if wildcard flag is set.
|
// Ignored if wildcard flag is set.
|
||||||
refs.ContainerID container_id = 3 [json_name = "containerID"];
|
refs.ContainerID container_id = 3 [ json_name = "containerID" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// NeoFS Session Token.
|
// NeoFS Session Token.
|
||||||
|
@ -90,55 +90,55 @@ message SessionToken {
|
||||||
// Session Token body
|
// Session Token body
|
||||||
message Body {
|
message Body {
|
||||||
// Token identifier is a valid UUIDv4 in binary form
|
// Token identifier is a valid UUIDv4 in binary form
|
||||||
bytes id = 1 [json_name = "id"];
|
bytes id = 1 [ json_name = "id" ];
|
||||||
|
|
||||||
// Identifier of the session initiator
|
// Identifier of the session initiator
|
||||||
neo.fs.v2.refs.OwnerID owner_id = 2 [json_name = "ownerID"];
|
neo.fs.v2.refs.OwnerID owner_id = 2 [ json_name = "ownerID" ];
|
||||||
|
|
||||||
// Lifetime parameters of the token. Field names taken from rfc7519.
|
// Lifetime parameters of the token. Field names taken from rfc7519.
|
||||||
message TokenLifetime {
|
message TokenLifetime {
|
||||||
// Expiration Epoch
|
// Expiration Epoch
|
||||||
uint64 exp = 1 [json_name = "exp"];
|
uint64 exp = 1 [ json_name = "exp" ];
|
||||||
|
|
||||||
// Not valid before Epoch
|
// Not valid before Epoch
|
||||||
uint64 nbf = 2 [json_name = "nbf"];
|
uint64 nbf = 2 [ json_name = "nbf" ];
|
||||||
|
|
||||||
// Issued at Epoch
|
// Issued at Epoch
|
||||||
uint64 iat = 3 [json_name = "iat"];
|
uint64 iat = 3 [ json_name = "iat" ];
|
||||||
}
|
}
|
||||||
// Lifetime of the session
|
// Lifetime of the session
|
||||||
TokenLifetime lifetime = 3 [json_name = "lifetime"];
|
TokenLifetime lifetime = 3 [ json_name = "lifetime" ];
|
||||||
|
|
||||||
// Public key used in session
|
// Public key used in session
|
||||||
bytes session_key = 4 [json_name = "sessionKey"];
|
bytes session_key = 4 [ json_name = "sessionKey" ];
|
||||||
|
|
||||||
// Session Context information
|
// Session Context information
|
||||||
oneof context {
|
oneof context {
|
||||||
// ObjectService session context
|
// ObjectService session context
|
||||||
ObjectSessionContext object = 5 [json_name = "object"];
|
ObjectSessionContext object = 5 [ json_name = "object" ];
|
||||||
|
|
||||||
// ContainerService session context
|
// ContainerService session context
|
||||||
ContainerSessionContext container = 6 [json_name = "container"];
|
ContainerSessionContext container = 6 [ json_name = "container" ];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Session Token contains the proof of trust between peers to be attached in
|
// Session Token contains the proof of trust between peers to be attached in
|
||||||
// requests for further verification. Please see corresponding section of
|
// requests for further verification. Please see corresponding section of
|
||||||
// NeoFS Technical Specification for details.
|
// NeoFS Technical Specification for details.
|
||||||
Body body = 1 [json_name = "body"];
|
Body body = 1 [ json_name = "body" ];
|
||||||
|
|
||||||
// Signature of `SessionToken` information
|
// Signature of `SessionToken` information
|
||||||
neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"];
|
neo.fs.v2.refs.Signature signature = 2 [ json_name = "signature" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extended headers for Request/Response. They may contain any user-defined headers
|
// Extended headers for Request/Response. They may contain any user-defined
|
||||||
// to be interpreted on application level.
|
// headers to be interpreted on application level.
|
||||||
//
|
//
|
||||||
// Key name must be a unique valid UTF-8 string. Value can't be empty. Requests or
|
// Key name must be a unique valid UTF-8 string. Value can't be empty. Requests
|
||||||
// Responses with duplicated header names or headers with empty values will be
|
// or Responses with duplicated header names or headers with empty values will
|
||||||
// considered invalid.
|
// be considered invalid.
|
||||||
//
|
//
|
||||||
// There are some "well-known" headers starting with `__SYSTEM__` (`__NEOFS__` is deprecated) prefix that
|
// There are some "well-known" headers starting with `__SYSTEM__` (`__NEOFS__`
|
||||||
// affect system behaviour:
|
// is deprecated) prefix that affect system behaviour:
|
||||||
//
|
//
|
||||||
// * [ __SYSTEM__NETMAP_EPOCH ] \
|
// * [ __SYSTEM__NETMAP_EPOCH ] \
|
||||||
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
||||||
|
@ -149,88 +149,90 @@ message SessionToken {
|
||||||
// (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \
|
// (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \
|
||||||
// If object can't be found using current epoch's netmap, this header limits
|
// If object can't be found using current epoch's netmap, this header limits
|
||||||
// how many past epochs the node can look up through. The `value` is string
|
// how many past epochs the node can look up through. The `value` is string
|
||||||
// encoded `uint64` in decimal presentation. If set to '0' or not set, only the
|
// encoded `uint64` in decimal presentation. If set to '0' or not set, only
|
||||||
// current epoch will be used.
|
// the current epoch will be used.
|
||||||
message XHeader {
|
message XHeader {
|
||||||
// Key of the X-Header
|
// Key of the X-Header
|
||||||
string key = 1 [json_name = "key"];
|
string key = 1 [ json_name = "key" ];
|
||||||
|
|
||||||
// Value of the X-Header
|
// Value of the X-Header
|
||||||
string value = 2 [json_name = "value"];
|
string value = 2 [ json_name = "value" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Meta information attached to the request. When forwarded between peers,
|
// Meta information attached to the request. When forwarded between peers,
|
||||||
// request meta headers are folded in matryoshka style.
|
// request meta headers are folded in matryoshka style.
|
||||||
message RequestMetaHeader {
|
message RequestMetaHeader {
|
||||||
// Peer's API version used
|
// Peer's API version used
|
||||||
neo.fs.v2.refs.Version version = 1 [json_name = "version"];
|
neo.fs.v2.refs.Version version = 1 [ json_name = "version" ];
|
||||||
|
|
||||||
// Peer's local epoch number. Set to 0 if unknown.
|
// Peer's local epoch number. Set to 0 if unknown.
|
||||||
uint64 epoch = 2 [json_name = "epoch"];
|
uint64 epoch = 2 [ json_name = "epoch" ];
|
||||||
|
|
||||||
// Maximum number of intermediate nodes in the request route
|
// Maximum number of intermediate nodes in the request route
|
||||||
uint32 ttl = 3 [json_name = "ttl"];
|
uint32 ttl = 3 [ json_name = "ttl" ];
|
||||||
|
|
||||||
// Request X-Headers
|
// Request X-Headers
|
||||||
repeated XHeader x_headers = 4 [json_name = "xHeaders"];
|
repeated XHeader x_headers = 4 [ json_name = "xHeaders" ];
|
||||||
|
|
||||||
// Session token within which the request is sent
|
// Session token within which the request is sent
|
||||||
SessionToken session_token = 5 [json_name = "sessionToken"];
|
SessionToken session_token = 5 [ json_name = "sessionToken" ];
|
||||||
|
|
||||||
// `BearerToken` with eACL overrides for the request
|
// `BearerToken` with eACL overrides for the request
|
||||||
neo.fs.v2.acl.BearerToken bearer_token = 6 [json_name = "bearerToken"];
|
neo.fs.v2.acl.BearerToken bearer_token = 6 [ json_name = "bearerToken" ];
|
||||||
|
|
||||||
// `RequestMetaHeader` of the origin request
|
// `RequestMetaHeader` of the origin request
|
||||||
RequestMetaHeader origin = 7 [json_name = "origin"];
|
RequestMetaHeader origin = 7 [ json_name = "origin" ];
|
||||||
|
|
||||||
// NeoFS network magic. Must match the value for the network
|
// NeoFS network magic. Must match the value for the network
|
||||||
// that the server belongs to.
|
// that the server belongs to.
|
||||||
uint64 magic_number = 8 [json_name = "magicNumber"];
|
uint64 magic_number = 8 [ json_name = "magicNumber" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Information about the response
|
// Information about the response
|
||||||
message ResponseMetaHeader {
|
message ResponseMetaHeader {
|
||||||
// Peer's API version used
|
// Peer's API version used
|
||||||
neo.fs.v2.refs.Version version = 1 [json_name = "version"];
|
neo.fs.v2.refs.Version version = 1 [ json_name = "version" ];
|
||||||
|
|
||||||
// Peer's local epoch number
|
// Peer's local epoch number
|
||||||
uint64 epoch = 2 [json_name = "epoch"];
|
uint64 epoch = 2 [ json_name = "epoch" ];
|
||||||
|
|
||||||
// Maximum number of intermediate nodes in the request route
|
// Maximum number of intermediate nodes in the request route
|
||||||
uint32 ttl = 3 [json_name = "ttl"];
|
uint32 ttl = 3 [ json_name = "ttl" ];
|
||||||
|
|
||||||
// Response X-Headers
|
// Response X-Headers
|
||||||
repeated XHeader x_headers = 4 [json_name = "xHeaders"];
|
repeated XHeader x_headers = 4 [ json_name = "xHeaders" ];
|
||||||
|
|
||||||
// `ResponseMetaHeader` of the origin request
|
// `ResponseMetaHeader` of the origin request
|
||||||
ResponseMetaHeader origin = 5 [json_name = "origin"];
|
ResponseMetaHeader origin = 5 [ json_name = "origin" ];
|
||||||
|
|
||||||
// Status return
|
// Status return
|
||||||
neo.fs.v2.status.Status status = 6 [json_name = "status"];
|
neo.fs.v2.status.Status status = 6 [ json_name = "status" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verification info for the request signed by all intermediate nodes.
|
// Verification info for the request signed by all intermediate nodes.
|
||||||
message RequestVerificationHeader {
|
message RequestVerificationHeader {
|
||||||
// Request Body signature. Should be generated once by the request initiator.
|
// Request Body signature. Should be generated once by the request initiator.
|
||||||
neo.fs.v2.refs.Signature body_signature = 1 [json_name = "bodySignature"];
|
neo.fs.v2.refs.Signature body_signature = 1 [ json_name = "bodySignature" ];
|
||||||
// Request Meta signature is added and signed by each intermediate node
|
// Request Meta signature is added and signed by each intermediate node
|
||||||
neo.fs.v2.refs.Signature meta_signature = 2 [json_name = "metaSignature"];
|
neo.fs.v2.refs.Signature meta_signature = 2 [ json_name = "metaSignature" ];
|
||||||
// Signature of previous hops
|
// Signature of previous hops
|
||||||
neo.fs.v2.refs.Signature origin_signature = 3 [json_name = "originSignature"];
|
neo.fs.v2.refs.Signature origin_signature = 3
|
||||||
|
[ json_name = "originSignature" ];
|
||||||
|
|
||||||
// Chain of previous hops signatures
|
// Chain of previous hops signatures
|
||||||
RequestVerificationHeader origin = 4 [json_name = "origin"];
|
RequestVerificationHeader origin = 4 [ json_name = "origin" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verification info for the response signed by all intermediate nodes
|
// Verification info for the response signed by all intermediate nodes
|
||||||
message ResponseVerificationHeader {
|
message ResponseVerificationHeader {
|
||||||
// Response Body signature. Should be generated once by an answering node.
|
// Response Body signature. Should be generated once by an answering node.
|
||||||
neo.fs.v2.refs.Signature body_signature = 1 [json_name = "bodySignature"];
|
neo.fs.v2.refs.Signature body_signature = 1 [ json_name = "bodySignature" ];
|
||||||
// Response Meta signature is added and signed by each intermediate node
|
// Response Meta signature is added and signed by each intermediate node
|
||||||
neo.fs.v2.refs.Signature meta_signature = 2 [json_name = "metaSignature"];
|
neo.fs.v2.refs.Signature meta_signature = 2 [ json_name = "metaSignature" ];
|
||||||
// Signature of previous hops
|
// Signature of previous hops
|
||||||
neo.fs.v2.refs.Signature origin_signature = 3 [json_name = "originSignature"];
|
neo.fs.v2.refs.Signature origin_signature = 3
|
||||||
|
[ json_name = "originSignature" ];
|
||||||
|
|
||||||
// Chain of previous hops signatures
|
// Chain of previous hops signatures
|
||||||
ResponseVerificationHeader origin = 4 [json_name = "origin"];
|
ResponseVerificationHeader origin = 4 [ json_name = "origin" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,113 +33,113 @@ option csharp_namespace = "Neo.FileStorage.API.Status";
|
||||||
// should not expect) useful information in the message. Field `details`
|
// should not expect) useful information in the message. Field `details`
|
||||||
// should make the return more detailed.
|
// should make the return more detailed.
|
||||||
message Status {
|
message Status {
|
||||||
// The status code
|
// The status code
|
||||||
uint32 code = 1;
|
uint32 code = 1;
|
||||||
|
|
||||||
// Developer-facing error message
|
// Developer-facing error message
|
||||||
string message = 2;
|
string message = 2;
|
||||||
|
|
||||||
// Return detail. It contains additional information that can be used to
|
// Return detail. It contains additional information that can be used to
|
||||||
// analyze the response. Each code defines a set of details that can be
|
// analyze the response. Each code defines a set of details that can be
|
||||||
// attached to a status. Client should not handle details that are not
|
// attached to a status. Client should not handle details that are not
|
||||||
// covered by the code.
|
// covered by the code.
|
||||||
message Detail {
|
message Detail {
|
||||||
// Detail ID. The identifier is required to determine the binary format
|
// Detail ID. The identifier is required to determine the binary format
|
||||||
// of the detail and how to decode it.
|
// of the detail and how to decode it.
|
||||||
uint32 id = 1;
|
uint32 id = 1;
|
||||||
|
|
||||||
// Binary status detail. Must follow the format associated with ID.
|
// Binary status detail. Must follow the format associated with ID.
|
||||||
// The possibility of missing a value must be explicitly allowed.
|
// The possibility of missing a value must be explicitly allowed.
|
||||||
bytes value = 2;
|
bytes value = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Data detailing the outcome of the operation. Must be unique by ID.
|
// Data detailing the outcome of the operation. Must be unique by ID.
|
||||||
repeated Detail details = 3;
|
repeated Detail details = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Section identifiers.
|
// Section identifiers.
|
||||||
enum Section {
|
enum Section {
|
||||||
// Successful return codes.
|
// Successful return codes.
|
||||||
SECTION_SUCCESS = 0;
|
SECTION_SUCCESS = 0;
|
||||||
|
|
||||||
// Failure codes regardless of the operation.
|
// Failure codes regardless of the operation.
|
||||||
SECTION_FAILURE_COMMON = 1;
|
SECTION_FAILURE_COMMON = 1;
|
||||||
|
|
||||||
// Object service-specific errors.
|
// Object service-specific errors.
|
||||||
SECTION_OBJECT = 2;
|
SECTION_OBJECT = 2;
|
||||||
|
|
||||||
// Container service-specific errors.
|
// Container service-specific errors.
|
||||||
SECTION_CONTAINER = 3;
|
SECTION_CONTAINER = 3;
|
||||||
|
|
||||||
// Session service-specific errors.
|
// Session service-specific errors.
|
||||||
SECTION_SESSION = 4;
|
SECTION_SESSION = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Section of NeoFS successful return codes.
|
// Section of NeoFS successful return codes.
|
||||||
enum Success {
|
enum Success {
|
||||||
// [**0**] Default success. Not detailed.
|
// [**0**] Default success. Not detailed.
|
||||||
// If the server cannot match successful outcome to the code, it should
|
// If the server cannot match successful outcome to the code, it should
|
||||||
// use this code.
|
// use this code.
|
||||||
OK = 0;
|
OK = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Section of failed statuses independent of the operation.
|
// Section of failed statuses independent of the operation.
|
||||||
enum CommonFail {
|
enum CommonFail {
|
||||||
// [**1024**] Internal server error, default failure. Not detailed.
|
// [**1024**] Internal server error, default failure. Not detailed.
|
||||||
// If the server cannot match failed outcome to the code, it should
|
// If the server cannot match failed outcome to the code, it should
|
||||||
// use this code.
|
// use this code.
|
||||||
INTERNAL = 0;
|
INTERNAL = 0;
|
||||||
|
|
||||||
// [**1025**] Wrong magic of the NeoFS network.
|
// [**1025**] Wrong magic of the NeoFS network.
|
||||||
// Details:
|
// Details:
|
||||||
// - [**0**] Magic number of the served NeoFS network (big-endian 64-bit
|
// - [**0**] Magic number of the served NeoFS network (big-endian 64-bit
|
||||||
// unsigned integer).
|
// unsigned integer).
|
||||||
WRONG_MAGIC_NUMBER = 1;
|
WRONG_MAGIC_NUMBER = 1;
|
||||||
|
|
||||||
// [**1026**] Signature verification failure.
|
// [**1026**] Signature verification failure.
|
||||||
SIGNATURE_VERIFICATION_FAIL = 2;
|
SIGNATURE_VERIFICATION_FAIL = 2;
|
||||||
|
|
||||||
// [**1027**] Node is under maintenance.
|
// [**1027**] Node is under maintenance.
|
||||||
NODE_UNDER_MAINTENANCE = 3;
|
NODE_UNDER_MAINTENANCE = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Section of statuses for object-related operations.
|
// Section of statuses for object-related operations.
|
||||||
enum Object {
|
enum Object {
|
||||||
// [**2048**] Access denied by ACL.
|
// [**2048**] Access denied by ACL.
|
||||||
// Details:
|
// Details:
|
||||||
// - [**0**] Human-readable description (UTF-8 encoded string).
|
// - [**0**] Human-readable description (UTF-8 encoded string).
|
||||||
ACCESS_DENIED = 0;
|
ACCESS_DENIED = 0;
|
||||||
|
|
||||||
// [**2049**] Object not found.
|
// [**2049**] Object not found.
|
||||||
OBJECT_NOT_FOUND = 1;
|
OBJECT_NOT_FOUND = 1;
|
||||||
|
|
||||||
// [**2050**] Operation rejected by the object lock.
|
// [**2050**] Operation rejected by the object lock.
|
||||||
LOCKED = 2;
|
LOCKED = 2;
|
||||||
|
|
||||||
// [**2051**] Locking an object with a non-REGULAR type rejected.
|
// [**2051**] Locking an object with a non-REGULAR type rejected.
|
||||||
LOCK_NON_REGULAR_OBJECT = 3;
|
LOCK_NON_REGULAR_OBJECT = 3;
|
||||||
|
|
||||||
// [**2052**] Object has been marked deleted.
|
// [**2052**] Object has been marked deleted.
|
||||||
OBJECT_ALREADY_REMOVED = 4;
|
OBJECT_ALREADY_REMOVED = 4;
|
||||||
|
|
||||||
// [**2053**] Invalid range has been requested for an object.
|
// [**2053**] Invalid range has been requested for an object.
|
||||||
OUT_OF_RANGE = 5;
|
OUT_OF_RANGE = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Section of statuses for container-related operations.
|
// Section of statuses for container-related operations.
|
||||||
enum Container {
|
enum Container {
|
||||||
// [**3072**] Container not found.
|
// [**3072**] Container not found.
|
||||||
CONTAINER_NOT_FOUND = 0;
|
CONTAINER_NOT_FOUND = 0;
|
||||||
|
|
||||||
// [**3073**] eACL table not found.
|
// [**3073**] eACL table not found.
|
||||||
EACL_NOT_FOUND = 1;
|
EACL_NOT_FOUND = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Section of statuses for session-related operations.
|
// Section of statuses for session-related operations.
|
||||||
enum Session {
|
enum Session {
|
||||||
// [**4096**] Token not found.
|
// [**4096**] Token not found.
|
||||||
TOKEN_NOT_FOUND = 0;
|
TOKEN_NOT_FOUND = 0;
|
||||||
|
|
||||||
// [**4097**] Token has expired.
|
// [**4097**] Token has expired.
|
||||||
TOKEN_EXPIRED = 1;
|
TOKEN_EXPIRED = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,17 +10,18 @@ import "refs/types.proto";
|
||||||
// Tombstone keeps record of deleted objects for a few epochs until they are
|
// Tombstone keeps record of deleted objects for a few epochs until they are
|
||||||
// purged from the NeoFS network.
|
// purged from the NeoFS network.
|
||||||
message Tombstone {
|
message Tombstone {
|
||||||
// Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone
|
// Last NeoFS epoch number of the tombstone lifetime. It's set by the
|
||||||
// creator depending on the current NeoFS network settings. A tombstone object
|
// tombstone creator depending on the current NeoFS network settings. A
|
||||||
// must have the same expiration epoch value in `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated)
|
// tombstone object must have the same expiration epoch value in
|
||||||
|
// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated)
|
||||||
// attribute. Otherwise, the tombstone will be rejected by a storage node.
|
// attribute. Otherwise, the tombstone will be rejected by a storage node.
|
||||||
uint64 expiration_epoch = 1 [json_name = "expirationEpoch"];
|
uint64 expiration_epoch = 1 [ json_name = "expirationEpoch" ];
|
||||||
|
|
||||||
// 16 byte UUID used to identify the split object hierarchy parts. Must be
|
// 16 byte UUID used to identify the split object hierarchy parts. Must be
|
||||||
// unique inside a container. All objects participating in the split must
|
// unique inside a container. All objects participating in the split must
|
||||||
// have the same `split_id` value.
|
// have the same `split_id` value.
|
||||||
bytes split_id = 2 [json_name = "splitID"];
|
bytes split_id = 2 [ json_name = "splitID" ];
|
||||||
|
|
||||||
// List of objects to be deleted.
|
// List of objects to be deleted.
|
||||||
repeated neo.fs.v2.refs.ObjectID members = 3 [json_name = "members"];
|
repeated neo.fs.v2.refs.ObjectID members = 3 [ json_name = "members" ];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue