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-09-07 11:32:37 +00:00
|
|
|
// Selector modifier showing how the node set will be formed
|
|
|
|
// By default selector just groups by attribute into a bucket selecting nodes
|
|
|
|
// only by their hash distance.
|
|
|
|
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-08-23 11:42:01 +00:00
|
|
|
// Filter
|
|
|
|
message Filter {
|
|
|
|
// 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
|
|
|
|
string name = 1;
|
|
|
|
|
|
|
|
// Key to filter
|
|
|
|
string key = 2;
|
|
|
|
|
|
|
|
// Filtering operation
|
|
|
|
Operation op = 3;
|
|
|
|
|
|
|
|
// Value to match
|
|
|
|
string value = 4;
|
|
|
|
|
|
|
|
// List of inner filters. Top level operation will be applied to the whole list.
|
|
|
|
repeated Filter filters = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Selector
|
|
|
|
message Selector {
|
|
|
|
// Selector name to reference in object placement section
|
|
|
|
string name = 1;
|
|
|
|
|
|
|
|
// How many nodes to select from bucket
|
|
|
|
uint32 count = 2;
|
|
|
|
|
2020-09-07 11:32:37 +00:00
|
|
|
// Selector modifier showing how to form a bucket
|
|
|
|
Clause clause = 3;
|
|
|
|
|
2020-08-23 11:42:01 +00:00
|
|
|
// Attribute bucket to select from
|
2020-09-07 11:32:37 +00:00
|
|
|
string attribute = 4;
|
2020-08-23 11:42:01 +00:00
|
|
|
|
|
|
|
// Filter reference to select from
|
2020-09-07 11:32:37 +00:00
|
|
|
string filter = 5;
|
2020-08-23 11:42:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Exact bucket for each replica
|
|
|
|
message Replica {
|
|
|
|
// How many object replicas to put
|
|
|
|
uint32 count = 1;
|
|
|
|
|
|
|
|
// Named selector bucket to put in
|
|
|
|
string selector = 2;
|
|
|
|
}
|
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
// Set of rules to select a subset of nodes able to store container's objects
|
|
|
|
message PlacementPolicy {
|
2020-08-23 11:42:01 +00:00
|
|
|
// Rules to set number of object replicas and place each one into a particular bucket
|
|
|
|
repeated Replica replicas = 1;
|
|
|
|
|
|
|
|
// Container backup factor controls how deep NeoFS will search for nodes
|
|
|
|
// alternatives to include into container.
|
|
|
|
uint32 container_backup_factor = 2;
|
|
|
|
|
|
|
|
// Set of Selectors to form the container's nodes subset
|
|
|
|
repeated Selector selectors = 3;
|
|
|
|
|
|
|
|
// List of named filters to reference in selectors
|
|
|
|
repeated Filter filters = 4;
|
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-08-31 10:56:03 +00:00
|
|
|
bytes public_key = 1;
|
|
|
|
|
|
|
|
// Ways to connect to a node
|
|
|
|
string address = 2;
|
2020-08-05 21:58:09 +00:00
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
// Attributes of the NeoFS node.
|
2020-08-11 09:03:50 +00:00
|
|
|
message Attribute {
|
2020-08-12 21:43:51 +00:00
|
|
|
// Key of the node attribute.
|
2020-08-11 09:03:50 +00:00
|
|
|
string key = 1;
|
2020-08-05 21:58:09 +00:00
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
// Value of the node attribute.
|
2020-08-11 09:03:50 +00:00
|
|
|
string value = 2;
|
2020-08-23 11:42:01 +00:00
|
|
|
|
|
|
|
// Parent keys, if any
|
|
|
|
// Example: For City it can be Region or Country
|
|
|
|
repeated string parents = 3;
|
2020-08-11 09:03:50 +00:00
|
|
|
}
|
|
|
|
// Carries list of the NeoFS node attributes in a string key-value format.
|
|
|
|
repeated Attribute attributes = 3;
|
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.
|
|
|
|
State state = 4;
|
2020-08-12 21:43:51 +00:00
|
|
|
}
|