2020-08-05 21:52:40 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
package neo.fs.v2.netmap;
|
2020-08-05 21:52:40 +00:00
|
|
|
|
2020-08-14 18:27:31 +00:00
|
|
|
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/netmap/grpc;netmap";
|
2020-08-12 21:43:51 +00:00
|
|
|
option csharp_namespace = "NeoFS.API.v2.Netmap";
|
2020-08-05 21:52:40 +00:00
|
|
|
|
2020-08-23 11:42:01 +00:00
|
|
|
// Operations on filters
|
|
|
|
enum Operation {
|
|
|
|
// No Operation defined
|
|
|
|
OPERATION_UNSPECIFIED = 0;
|
|
|
|
|
|
|
|
// Equal
|
|
|
|
EQ = 1;
|
|
|
|
|
|
|
|
// Not Equal
|
|
|
|
NE = 2;
|
|
|
|
|
|
|
|
// Greater then
|
|
|
|
GT = 3;
|
|
|
|
|
|
|
|
// Greater or equal
|
|
|
|
GE = 4;
|
|
|
|
|
|
|
|
// Less then
|
|
|
|
LT = 5;
|
|
|
|
|
|
|
|
// Less or equal
|
|
|
|
LE = 6;
|
|
|
|
|
|
|
|
// Logical OR
|
|
|
|
OR = 7;
|
|
|
|
|
|
|
|
// Logical AND
|
|
|
|
AND = 8;
|
|
|
|
}
|
|
|
|
|
2020-10-15 07:50:36 +00:00
|
|
|
// Selector modifier shows how the node set will be formed. By default selector
|
|
|
|
// just groups nodes into a bucket by attribute, selecting nodes only by their
|
|
|
|
// hash distance.
|
2020-09-07 11:32:37 +00:00
|
|
|
enum Clause{
|
|
|
|
// No modifier defined. Will select nodes from bucket randomly.
|
|
|
|
CLAUSE_UNSPECIFIED = 0;
|
|
|
|
|
|
|
|
// SAME will select only nodes having the same value of bucket attribute
|
|
|
|
SAME = 1;
|
|
|
|
|
|
|
|
// DISTINCT will select nodes having different values of bucket attribute
|
|
|
|
DISTINCT = 2;
|
|
|
|
}
|
|
|
|
|
2020-10-15 07:50:36 +00:00
|
|
|
// Filter will return the subset of nodes from `NetworkMap` or another filter's
|
|
|
|
// results, that will satisfy filter's conditions.
|
2020-08-23 11:42:01 +00:00
|
|
|
message Filter {
|
2020-10-15 07:50:36 +00:00
|
|
|
// Name of the filter or a reference to the named filter. '*' means
|
|
|
|
// 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
|
|
|
|
// named filter
|
2020-10-19 08:24:58 +00:00
|
|
|
string name = 1 [json_name = "name"];
|
2020-08-23 11:42:01 +00:00
|
|
|
|
|
|
|
// Key to filter
|
2020-10-19 08:24:58 +00:00
|
|
|
string key = 2 [json_name = "key"];
|
2020-08-23 11:42:01 +00:00
|
|
|
|
|
|
|
// Filtering operation
|
2020-10-19 08:24:58 +00:00
|
|
|
Operation op = 3 [json_name = "op"];
|
2020-08-23 11:42:01 +00:00
|
|
|
|
|
|
|
// Value to match
|
2020-10-19 08:24:58 +00:00
|
|
|
string value = 4 [json_name = "value"];
|
2020-08-23 11:42:01 +00:00
|
|
|
|
2020-10-15 07:50:36 +00:00
|
|
|
// List of inner filters. Top level operation will be applied to the whole
|
|
|
|
// list.
|
2020-10-19 08:24:58 +00:00
|
|
|
repeated Filter filters = 5 [json_name = "filters"];
|
2020-08-23 11:42:01 +00:00
|
|
|
}
|
|
|
|
|
2020-10-15 07:50:36 +00:00
|
|
|
// Selector chooses a number of nodes from the bucket taking the nearest nodes
|
|
|
|
// to the provided `ContainerID` by hash distance.
|
2020-08-23 11:42:01 +00:00
|
|
|
message Selector {
|
|
|
|
// Selector name to reference in object placement section
|
2020-10-19 08:24:58 +00:00
|
|
|
string name = 1 [json_name = "name"];
|
2020-08-23 11:42:01 +00:00
|
|
|
|
2020-10-15 07:50:36 +00:00
|
|
|
// How many nodes to select from the bucket
|
2020-10-19 08:24:58 +00:00
|
|
|
uint32 count = 2 [json_name = "count"];
|
2020-08-23 11:42:01 +00:00
|
|
|
|
2020-09-07 11:32:37 +00:00
|
|
|
// Selector modifier showing how to form a bucket
|
2020-10-19 08:24:58 +00:00
|
|
|
Clause clause = 3 [json_name = "clause"];
|
2020-09-07 11:32:37 +00:00
|
|
|
|
2020-08-23 11:42:01 +00:00
|
|
|
// Attribute bucket to select from
|
2020-10-19 08:24:58 +00:00
|
|
|
string attribute = 4 [json_name = "attribute"];
|
2020-08-23 11:42:01 +00:00
|
|
|
|
|
|
|
// Filter reference to select from
|
2020-10-19 08:24:58 +00:00
|
|
|
string filter = 5 [json_name = "filter"];
|
2020-08-23 11:42:01 +00:00
|
|
|
}
|
|
|
|
|
2020-10-15 07:50:36 +00:00
|
|
|
// Number of object replicas in a set of nodes from the defined selector. If no
|
|
|
|
// selector set the root bucket containing all possible nodes will be used by
|
|
|
|
// default.
|
2020-08-23 11:42:01 +00:00
|
|
|
message Replica {
|
|
|
|
// How many object replicas to put
|
2020-10-19 08:24:58 +00:00
|
|
|
uint32 count = 1 [json_name = "count"];
|
2020-08-23 11:42:01 +00:00
|
|
|
|
2020-10-15 07:50:36 +00:00
|
|
|
// Named selector bucket to put replicas
|
2020-10-19 08:24:58 +00:00
|
|
|
string selector = 2 [json_name = "selector"];
|
2020-08-23 11:42:01 +00:00
|
|
|
}
|
|
|
|
|
2020-10-15 07:50:36 +00:00
|
|
|
// Set of rules to select a subset of nodes from `NetworkMap` able to store
|
|
|
|
// container's objects. The format is simple enough to transpile from different
|
|
|
|
// storage policy definition languages.
|
2020-08-12 21:43:51 +00:00
|
|
|
message PlacementPolicy {
|
2020-10-15 07:50:36 +00:00
|
|
|
// Rules to set number of object replicas and place each one into a named
|
|
|
|
// bucket
|
2020-10-19 08:24:58 +00:00
|
|
|
repeated Replica replicas = 1 [json_name = "replicas"];
|
2020-08-23 11:42:01 +00:00
|
|
|
|
|
|
|
// Container backup factor controls how deep NeoFS will search for nodes
|
2020-10-15 07:50:36 +00:00
|
|
|
// alternatives to include into container's nodes subset
|
2020-10-19 08:24:58 +00:00
|
|
|
uint32 container_backup_factor = 2 [json_name = "containerBackupFactor"];
|
2020-08-23 11:42:01 +00:00
|
|
|
|
|
|
|
// Set of Selectors to form the container's nodes subset
|
2020-10-19 08:24:58 +00:00
|
|
|
repeated Selector selectors = 3 [json_name = "selectors"];
|
2020-08-23 11:42:01 +00:00
|
|
|
|
|
|
|
// List of named filters to reference in selectors
|
2020-10-19 08:24:58 +00:00
|
|
|
repeated Filter filters = 4 [json_name = "filters"];
|
2020-08-05 21:52:40 +00:00
|
|
|
}
|
2020-08-05 21:58:09 +00:00
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
// NeoFS node description
|
2020-08-05 21:58:09 +00:00
|
|
|
message NodeInfo {
|
2020-08-12 21:43:51 +00:00
|
|
|
// Public key of the NeoFS node in a binary format.
|
2020-10-19 08:24:58 +00:00
|
|
|
bytes public_key = 1 [json_name = "publicKey"];
|
2020-08-31 10:56:03 +00:00
|
|
|
|
|
|
|
// Ways to connect to a node
|
2020-10-19 08:24:58 +00:00
|
|
|
string address = 2 [json_name = "address"];
|
2020-08-05 21:58:09 +00:00
|
|
|
|
2020-10-13 16:37:14 +00:00
|
|
|
// Administrator-defined Attributes of the NeoFS Storage Node.
|
|
|
|
//
|
2020-12-08 10:48:51 +00:00
|
|
|
// `Attribute` is a Key-Value metadata pair. Key name must be a valid UTF-8
|
|
|
|
// string. Value can't be empty.
|
|
|
|
//
|
2020-10-13 16:37:14 +00:00
|
|
|
// Node's attributes are mostly used during Storage Policy evaluation to
|
|
|
|
// calculate object's placement and find a set of nodes satisfying policy
|
|
|
|
// requirements. There are some "well-known" node attributes common to all the
|
|
|
|
// Storage Nodes in the network and used implicitly with default values if not
|
|
|
|
// explicitly set:
|
|
|
|
//
|
|
|
|
// * Capacity \
|
|
|
|
// Total available disk space in Gigabytes.
|
|
|
|
// * Price \
|
|
|
|
// Price in GAS tokens for storing one GB of data during one Epoch. In node
|
|
|
|
// attributes it's a string presenting floating point number with comma or
|
|
|
|
// point delimiter for decimal part. In the Network Map it will be saved as
|
|
|
|
// 64-bit unsigned integer representing number of minimal token fractions.
|
|
|
|
// * Subnet \
|
|
|
|
// String ID of Node's storage subnet. There can be only one subnet served
|
|
|
|
// by the Storage Node.
|
2021-02-10 09:38:06 +00:00
|
|
|
// * UN-LOCODE \
|
2020-10-13 16:37:14 +00:00
|
|
|
// Node's geographic location in
|
|
|
|
// [UN/LOCODE](https://www.unece.org/cefact/codesfortrade/codes_index.html)
|
|
|
|
// format approximated to the nearest point defined in standard.
|
|
|
|
// * Country \
|
|
|
|
// Country code in
|
|
|
|
// [ISO 3166-1_alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
|
|
|
|
// format. Calculated automatically from `Locode` attribute
|
|
|
|
// * Region \
|
|
|
|
// Country's administative subdivision where node is located. Calculated
|
|
|
|
// automatically from `Locode` attribute based on `SubDiv` field. Presented
|
|
|
|
// in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.
|
|
|
|
// * City \
|
|
|
|
// City, town, village or rural area name where node is located written
|
|
|
|
// without diacritics . Calculated automatically from `Locode` attribute.
|
|
|
|
//
|
|
|
|
// For detailed description of each well-known attribute please see the
|
|
|
|
// corresponding section in NeoFS Technical specification.
|
2020-08-11 09:03:50 +00:00
|
|
|
message Attribute {
|
2020-08-12 21:43:51 +00:00
|
|
|
// Key of the node attribute.
|
2020-10-19 08:24:58 +00:00
|
|
|
string key = 1 [json_name = "key"];
|
2020-08-05 21:58:09 +00:00
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
// Value of the node attribute.
|
2020-10-19 08:24:58 +00:00
|
|
|
string value = 2 [json_name = "value"];
|
2020-08-23 11:42:01 +00:00
|
|
|
|
2020-10-13 16:37:14 +00:00
|
|
|
// Parent keys, if any. For example for `City` it could be `Region` and
|
|
|
|
// `Country`.
|
2020-10-19 08:24:58 +00:00
|
|
|
repeated string parents = 3 [json_name = "parents"];
|
2020-08-11 09:03:50 +00:00
|
|
|
}
|
2020-12-11 06:46:00 +00:00
|
|
|
// 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
|
|
|
|
// structures with duplicated attribute names or attributes with empty values
|
|
|
|
// will be considered invalid.
|
2020-10-19 08:24:58 +00:00
|
|
|
repeated Attribute attributes = 3 [json_name = "attributes"];
|
2020-08-05 21:58:09 +00:00
|
|
|
|
2020-08-11 09:03:50 +00:00
|
|
|
// Represents the enumeration of various states of the NeoFS node.
|
|
|
|
enum State {
|
2020-08-12 21:43:51 +00:00
|
|
|
// Unknown state.
|
2020-08-23 11:42:01 +00:00
|
|
|
UNSPECIFIED = 0;
|
2020-08-05 21:58:09 +00:00
|
|
|
|
2020-08-11 09:03:50 +00:00
|
|
|
// Active state in the network.
|
|
|
|
ONLINE = 1;
|
2020-08-05 21:58:09 +00:00
|
|
|
|
2020-08-11 09:03:50 +00:00
|
|
|
// Network unavailable state.
|
|
|
|
OFFLINE = 2;
|
|
|
|
}
|
2020-08-05 21:58:09 +00:00
|
|
|
|
2020-08-11 09:03:50 +00:00
|
|
|
// Carries state of the NeoFS node.
|
2020-10-19 08:24:58 +00:00
|
|
|
State state = 4 [json_name = "state"];
|
2020-08-12 21:43:51 +00:00
|
|
|
}
|