2018-07-27 22:11:44 +01:00
|
|
|
// Copyright (C) 2018 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
syntax = "proto3";
|
|
|
|
package statdb;
|
|
|
|
|
2018-11-29 18:39:27 +00:00
|
|
|
import "gogo.proto";
|
|
|
|
import "node.proto";
|
|
|
|
|
2018-08-25 02:52:58 +01:00
|
|
|
// StatDB defines the interface for retrieving and updating storagenode stats
|
2018-07-27 22:11:44 +01:00
|
|
|
service StatDB {
|
2018-08-25 02:52:58 +01:00
|
|
|
// Create a db entry for the provided storagenode ID
|
2018-07-27 22:11:44 +01:00
|
|
|
rpc Create(CreateRequest) returns (CreateResponse);
|
2018-08-25 02:52:58 +01:00
|
|
|
// Get uses a storagenode ID to get that storagenode's stats
|
2018-07-27 22:11:44 +01:00
|
|
|
rpc Get(GetRequest) returns (GetResponse);
|
2018-10-30 17:11:22 +00:00
|
|
|
// FindValidNodes gets a subset of storagenodes that fit minimum reputation args
|
|
|
|
rpc FindValidNodes(FindValidNodesRequest) returns (FindValidNodesResponse);
|
2018-11-26 17:08:29 +00:00
|
|
|
// Update updates all stats for a single storagenode
|
2018-07-27 22:11:44 +01:00
|
|
|
rpc Update(UpdateRequest) returns (UpdateResponse);
|
2018-11-26 17:08:29 +00:00
|
|
|
// UpdateUptime updates uptime stats for a single storagenode
|
|
|
|
rpc UpdateUptime(UpdateUptimeRequest) returns (UpdateUptimeResponse);
|
|
|
|
// UpdateAuditSuccess updates audit success stats for a single storagenode
|
|
|
|
rpc UpdateAuditSuccess(UpdateAuditSuccessRequest) returns (UpdateAuditSuccessResponse);
|
2018-08-25 02:52:58 +01:00
|
|
|
// UpdateBatch updates storagenode stats for multiple farmers at a time
|
2018-07-27 22:11:44 +01:00
|
|
|
rpc UpdateBatch(UpdateBatchRequest) returns (UpdateBatchResponse);
|
2018-10-16 18:40:34 +01:00
|
|
|
// CreateEntryIfNotExists creates a db entry if it didn't exist
|
|
|
|
rpc CreateEntryIfNotExists(CreateEntryIfNotExistsRequest) returns (CreateEntryIfNotExistsResponse);
|
2018-07-27 22:11:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CreateRequest is a request message for the Create rpc call
|
|
|
|
message CreateRequest {
|
2018-11-29 18:39:27 +00:00
|
|
|
node.Node node = 1;
|
|
|
|
node.NodeStats stats = 2;
|
2018-07-27 22:11:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// CreateResponse is a response message for the Create rpc call
|
|
|
|
message CreateResponse {
|
2018-11-29 18:39:27 +00:00
|
|
|
node.NodeStats stats = 1;
|
2018-07-27 22:11:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetRequest is a request message for the Get rpc call
|
|
|
|
message GetRequest {
|
2018-11-29 18:39:27 +00:00
|
|
|
bytes node_id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
|
2018-07-27 22:11:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetResponse is a response message for the Get rpc call
|
|
|
|
message GetResponse {
|
2018-11-29 18:39:27 +00:00
|
|
|
node.NodeStats stats = 1;
|
2018-07-27 22:11:44 +01:00
|
|
|
}
|
|
|
|
|
2018-10-30 17:11:22 +00:00
|
|
|
// FindValidNodesRequest is a request message for the FindValidNodes rpc call
|
|
|
|
message FindValidNodesRequest {
|
2018-11-29 18:39:27 +00:00
|
|
|
repeated bytes node_ids = 1 [(gogoproto.customtype) = "NodeID"];
|
|
|
|
node.NodeStats min_stats = 2;
|
2018-10-30 17:11:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// FindValidNodesResponse is a response message for the FindValidNodes rpc call
|
|
|
|
message FindValidNodesResponse {
|
2018-11-29 18:39:27 +00:00
|
|
|
repeated bytes passed_ids = 1 [(gogoproto.customtype) = "NodeID"];
|
|
|
|
repeated bytes failed_ids = 2 [(gogoproto.customtype) = "NodeID"];
|
2018-10-30 17:11:22 +00:00
|
|
|
}
|
|
|
|
|
2018-07-27 22:11:44 +01:00
|
|
|
// UpdateRequest is a request message for the Update rpc call
|
|
|
|
message UpdateRequest {
|
2018-11-29 18:39:27 +00:00
|
|
|
node.Node node = 1;
|
2018-07-27 22:11:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// UpdateRequest is a response message for the Update rpc call
|
|
|
|
message UpdateResponse {
|
2018-11-29 18:39:27 +00:00
|
|
|
node.NodeStats stats = 1;
|
2018-07-27 22:11:44 +01:00
|
|
|
}
|
|
|
|
|
2018-11-26 17:08:29 +00:00
|
|
|
// UpdateUptimeRequest is a request message for the UpdateUptime rpc call
|
|
|
|
message UpdateUptimeRequest {
|
2018-11-29 18:39:27 +00:00
|
|
|
node.Node node = 1;
|
2018-11-26 17:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// UpdateUptimeResponse is a response message for the UpdateUptime rpc call
|
|
|
|
message UpdateUptimeResponse {
|
2018-11-29 18:39:27 +00:00
|
|
|
node.NodeStats stats = 1;
|
2018-11-26 17:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// UpdateAuditSuccessRequest is a request message for the UpdateAuditSuccess rpc call
|
|
|
|
message UpdateAuditSuccessRequest {
|
2018-11-29 18:39:27 +00:00
|
|
|
node.Node node = 1;
|
2018-11-26 17:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// UpdateAuditSuccessResponse is a response message for the UpdateAuditSuccess rpc call
|
|
|
|
message UpdateAuditSuccessResponse {
|
2018-11-29 18:39:27 +00:00
|
|
|
node.NodeStats stats = 1;
|
2018-11-26 17:08:29 +00:00
|
|
|
}
|
|
|
|
|
2018-07-27 22:11:44 +01:00
|
|
|
// UpdateBatchRequest is a request message for the UpdateBatch rpc call
|
|
|
|
message UpdateBatchRequest {
|
2018-11-29 18:39:27 +00:00
|
|
|
repeated node.Node node_list = 1;
|
2018-07-27 22:11:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// UpdateBatchResponse is a response message for the UpdateBatch rpc call
|
|
|
|
message UpdateBatchResponse {
|
2018-11-29 18:39:27 +00:00
|
|
|
repeated node.NodeStats stats_list = 1;
|
|
|
|
repeated node.Node failed_nodes = 2;
|
2018-10-16 18:40:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// CreateEntryIfNotExistsRequest is a request message for the CreateEntryIfNotExists rpc call
|
|
|
|
message CreateEntryIfNotExistsRequest {
|
2018-11-29 18:39:27 +00:00
|
|
|
node.Node node = 1;
|
2018-10-16 18:40:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// CreateEntryIfNotExistsResponse is a response message for the CreateEntryIfNotExists rpc call
|
|
|
|
message CreateEntryIfNotExistsResponse {
|
2018-11-29 18:39:27 +00:00
|
|
|
node.NodeStats stats = 1;
|
2018-07-27 22:11:44 +01:00
|
|
|
}
|