[#1048] control: Add ListShards rpc to proto files

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-12-17 15:27:36 +03:00 committed by Alex Vanin
parent 5d46035ae8
commit 20f11c88ca
2 changed files with 61 additions and 0 deletions

View file

@ -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;
}

View file

@ -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;
}