storj/pkg/statdb/proto/statdb.proto
Maximillian von Briesen 828a8b6907
Change statdb.FindValidNodes to FindInvalidNodes (#774)
* Remove statdb.FindValidNodes
* Add statdb.FindInvalidNodes for getting nodes that fall below a reputation threshold
2018-12-05 15:23:32 -05:00

113 lines
3.7 KiB
Protocol Buffer

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
syntax = "proto3";
package statdb;
import "gogo.proto";
import "node.proto";
// StatDB defines the interface for retrieving and updating storagenode stats
service StatDB {
// Create a db entry for the provided storagenode ID
rpc Create(CreateRequest) returns (CreateResponse);
// Get uses a storagenode ID to get that storagenode's stats
rpc Get(GetRequest) returns (GetResponse);
// FindInvalidNodes gets a subset of storagenodes that fail to meet minimum reputation args
rpc FindInvalidNodes(FindInvalidNodesRequest) returns (FindInvalidNodesResponse);
// Update updates all stats for a single storagenode
rpc Update(UpdateRequest) returns (UpdateResponse);
// 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);
// UpdateBatch updates storagenode stats for multiple farmers at a time
rpc UpdateBatch(UpdateBatchRequest) returns (UpdateBatchResponse);
// CreateEntryIfNotExists creates a db entry if it didn't exist
rpc CreateEntryIfNotExists(CreateEntryIfNotExistsRequest) returns (CreateEntryIfNotExistsResponse);
}
// CreateRequest is a request message for the Create rpc call
message CreateRequest {
node.Node node = 1;
node.NodeStats stats = 2;
}
// CreateResponse is a response message for the Create rpc call
message CreateResponse {
node.NodeStats stats = 1;
}
// GetRequest is a request message for the Get rpc call
message GetRequest {
bytes node_id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
}
// GetResponse is a response message for the Get rpc call
message GetResponse {
node.NodeStats stats = 1;
}
// FindInvalidNodesRequest is a request message for the FindInvalidNodes rpc call
message FindInvalidNodesRequest {
repeated bytes node_ids = 1 [(gogoproto.customtype) = "NodeID"];
node.NodeStats max_stats = 2;
}
// FindInvalidNodesResponse is a response message for the FindInvalidNodes rpc call
message FindInvalidNodesResponse {
repeated bytes invalid_ids = 1 [(gogoproto.customtype) = "NodeID"];
}
// UpdateRequest is a request message for the Update rpc call
message UpdateRequest {
node.Node node = 1;
}
// UpdateRequest is a response message for the Update rpc call
message UpdateResponse {
node.NodeStats stats = 1;
}
// UpdateUptimeRequest is a request message for the UpdateUptime rpc call
message UpdateUptimeRequest {
node.Node node = 1;
}
// UpdateUptimeResponse is a response message for the UpdateUptime rpc call
message UpdateUptimeResponse {
node.NodeStats stats = 1;
}
// UpdateAuditSuccessRequest is a request message for the UpdateAuditSuccess rpc call
message UpdateAuditSuccessRequest {
node.Node node = 1;
}
// UpdateAuditSuccessResponse is a response message for the UpdateAuditSuccess rpc call
message UpdateAuditSuccessResponse {
node.NodeStats stats = 1;
}
// UpdateBatchRequest is a request message for the UpdateBatch rpc call
message UpdateBatchRequest {
repeated node.Node node_list = 1;
}
// UpdateBatchResponse is a response message for the UpdateBatch rpc call
message UpdateBatchResponse {
repeated node.NodeStats stats_list = 1;
repeated node.Node failed_nodes = 2;
}
// CreateEntryIfNotExistsRequest is a request message for the CreateEntryIfNotExists rpc call
message CreateEntryIfNotExistsRequest {
node.Node node = 1;
}
// CreateEntryIfNotExistsResponse is a response message for the CreateEntryIfNotExists rpc call
message CreateEntryIfNotExistsResponse {
node.NodeStats stats = 1;
}