From 031579a68dae514b21be6702a970d2ff4c0c81b7 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 00:58:09 +0300 Subject: [PATCH] [#34] bootstrap: Move NodeInfo to netmap Move NodeInfo message definition to netmap package. Package bootstrap is completely removed from the repository. Signed-off-by: Leonard Lyubich --- bootstrap/types.proto | 42 ------------------------------------------ netmap/types.proto | 36 ++++++++++++++++++++++++++++++++++++ proto-docs/netmap.md | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 42 deletions(-) delete mode 100644 bootstrap/types.proto diff --git a/bootstrap/types.proto b/bootstrap/types.proto deleted file mode 100644 index c7d99bb..0000000 --- a/bootstrap/types.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; - -package bootstrap; - -option go_package = "github.com/nspcc-dev/neofs-api-go/bootstrap"; -option csharp_namespace = "NeoFS.API.Bootstrap"; - -// Groups the information about the NeoFS node. -message NodeInfo { - // Carries network address of the NeoFS node. - string Address = 1; - - // Carries public key of the NeoFS node in a binary format. - bytes PublicKey = 2; - - // Groups attributes of the NeoFS node. - message Attribute { - // Carries string key to the node attribute. - string Key = 1; - - // Carries string value of the node attribute. - string Value = 2; - } - - // // Carries list of the NeoFS node attributes in a string key-value format. - repeated Attribute Attributes = 3; - - // Represents the enumeration of various states of the NeoFS node. - enum State { - // Undefined state. - Unknown = 0; - - // Active state on the network. - Online = 1; - - // Network unavailable state. - Offline = 2; - } - - // Carries state of the NeoFS node. - State state = 4; -} diff --git a/netmap/types.proto b/netmap/types.proto index a0e4026..54ec189 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -54,3 +54,39 @@ message PlacementRule { repeated SFGroup SFGroups = 2; } + +// Groups the information about the NeoFS node. +message NodeInfo { + // Carries network address of the NeoFS node. + string Address = 1; + + // Carries public key of the NeoFS node in a binary format. + bytes PublicKey = 2; + + // Groups attributes of the NeoFS node. + message Attribute { + // Carries string key to the node attribute. + string Key = 1; + + // Carries string value of the node attribute. + string Value = 2; + } + + // // Carries list of the NeoFS node attributes in a string key-value format. + repeated Attribute Attributes = 3; + + // Represents the enumeration of various states of the NeoFS node. + enum State { + // Undefined state. + Unknown = 0; + + // Active state on the network. + Online = 1; + + // Network unavailable state. + Offline = 2; + } + + // Carries state of the NeoFS node. + State state = 4; +} \ No newline at end of file diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index e961682..4e25adb 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -6,6 +6,8 @@ - [netmap/types.proto](#netmap/types.proto) - Messages + - [NodeInfo](#netmap.NodeInfo) + - [NodeInfo.Attribute](#netmap.NodeInfo.Attribute) - [PlacementRule](#netmap.PlacementRule) - [PlacementRule.SFGroup](#netmap.PlacementRule.SFGroup) - [PlacementRule.SFGroup.Filter](#netmap.PlacementRule.SFGroup.Filter) @@ -27,6 +29,32 @@ + + +### Message NodeInfo +Groups the information about the NeoFS node. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Address | [string](#string) | | Carries network address of the NeoFS node. | +| PublicKey | [bytes](#bytes) | | Carries public key of the NeoFS node in a binary format. | +| Attributes | [NodeInfo.Attribute](#netmap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a string key-value format. | +| state | [NodeInfo.State](#netmap.NodeInfo.State) | | Carries state of the NeoFS node. | + + + + +### Message NodeInfo.Attribute +Groups attributes of the NeoFS node. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Key | [string](#string) | | Carries string key to the node attribute. | +| Value | [string](#string) | | Carries string value of the node attribute. | + + ### Message PlacementRule @@ -102,6 +130,19 @@ + + +### NodeInfo.State +Represents the enumeration of various states of the NeoFS node. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Unknown | 0 | Undefined state. | +| Online | 1 | Active state on the network. | +| Offline | 2 | Network unavailable state. | + + + ### PlacementRule.SFGroup.Filter.SimpleFilter.Operation