From 20f11c88ca97834d13ed200793c2237eda4daad7 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 17 Dec 2021 15:27:36 +0300 Subject: [PATCH] [#1048] control: Add `ListShards` rpc to proto files Signed-off-by: Pavel Karpy --- pkg/services/control/service.proto | 31 ++++++++++++++++++++++++++++++ pkg/services/control/types.proto | 30 +++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/pkg/services/control/service.proto b/pkg/services/control/service.proto index f6c82656d9..6ef38b0a62 100644 --- a/pkg/services/control/service.proto +++ b/pkg/services/control/service.proto @@ -19,6 +19,9 @@ service ControlService { // Mark objects to be removed from node's local object storage. rpc DropObjects (DropObjectsRequest) returns (DropObjectsResponse); + + // Returns list that contains information about all shards of a node. + rpc ListShards (ListShardsRequest) returns (ListShardsResponse); } // Health check request. @@ -136,3 +139,31 @@ message DropObjectsResponse { // Body signature. Signature signature = 2; } + +// Request to list all shards of the node. +message ListShardsRequest { + // Request body structure. + message Body { + } + + // Body of the request message. + Body body = 1; + + // Body signature. + Signature signature = 2; +} + +// ListShards response. +message ListShardsResponse { + // Response body structure. + message Body { + // List of the node's shards. + repeated ShardInfo shards = 1; + } + + // Body of the response message. + Body body = 1; + + // Body signature. + Signature signature = 2; +} diff --git a/pkg/services/control/types.proto b/pkg/services/control/types.proto index fe1890c1bf..14086bdc88 100644 --- a/pkg/services/control/types.proto +++ b/pkg/services/control/types.proto @@ -119,3 +119,33 @@ enum HealthStatus { // Storage node application is shutting down. SHUTTING_DOWN = 3; } + +// Shard description. +message ShardInfo { + // ID of the shard. + bytes shard_ID = 1 [json_name = "shardID"]; + + // Path to shard's metabase. + string metabase_path = 2 [json_name = "metabasePath"]; + + // Path to shard's blobstore. + string blobstor_path = 3 [json_name = "blobstorPath"]; + + // Path to shard's write-cache, empty if disabled. + string writecache_path = 4 [json_name = "writecachePath"]; + + // Work mode of the shard. + ShardMode mode = 5; +} + +// Work mode of the shard. +enum ShardMode { + // Undefined mode, default value. + SHARD_MODE_UNDEFINED = 0; + + // Read-write. + READ_WRITE = 1; + + // Read-only. + READ_ONLY = 2; +}