diff --git a/pkg/services/control/service.proto b/pkg/services/control/service.proto index f6c82656..6ef38b0a 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 fe1890c1..14086bdc 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; +}