storj/pkg/pb/inspector.proto
Kaloyan Raev 1ec17653d4 Endpoint for local node info (#1355)
Adds a new `Info` method to the Kademlia endpoint that returns the following local node info:
* ID
* Type
* Metadata (email and wallet)
* Restrictions (free storage and bandwidth)

The new endpoint is exposed as `inspector kad node-info` command too.
2019-02-25 19:41:51 +01:00

134 lines
3.3 KiB
Protocol Buffer

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
syntax = "proto3";
option go_package = "pb";
import "gogo.proto";
import "node.proto";
package inspector;
service KadInspector {
// CountNodes returns the number of nodes in the routing table
rpc CountNodes(CountNodesRequest) returns (CountNodesResponse);
// PingNode sends a PING RPC to a node and returns its availability
rpc PingNode(PingNodeRequest) returns (PingNodeResponse);
// LookupNode triggers a Kademlia FindNode and returns the response
rpc LookupNode(LookupNodeRequest) returns (LookupNodeResponse);
// NodeInfo sends a PING RPC to a node and returns its local info
rpc NodeInfo(NodeInfoRequest) returns (NodeInfoResponse);
// FindNear returns limit number of IDs "near" the Start ID
rpc FindNear(FindNearRequest) returns (FindNearResponse);
}
service OverlayInspector {
// CountNodes returns the number of nodes in the cache
rpc CountNodes(CountNodesRequest) returns (CountNodesResponse);
}
service StatDBInspector {
// GetStats returns the stats for a particular node ID
rpc GetStats(GetStatsRequest) returns (GetStatsResponse);
// CreateStats creates a node with specified stats
rpc CreateStats(CreateStatsRequest) returns (CreateStatsResponse);
}
// GetStats
message GetStatsRequest {
bytes node_id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
}
message GetStatsResponse {
int64 audit_count = 1;
double audit_ratio = 2;
int64 uptime_count = 3;
double uptime_ratio = 4;
}
// CreateStats
message CreateStatsRequest {
bytes node_id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
int64 audit_count = 2;
int64 audit_success_count = 3;
int64 uptime_count = 4;
int64 uptime_success_count = 5;
}
message CreateStatsResponse {
}
// CountNodes
message CountNodesResponse {
int64 count = 1;
}
message CountNodesRequest {
}
// GetBuckets
message GetBucketsRequest {
}
message GetBucketsResponse {
int64 total = 1;
repeated bytes ids = 2 [(gogoproto.customtype) = "NodeID"];
}
// GetBucket
message GetBucketRequest {
bytes id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
}
message GetBucketResponse {
bytes id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
repeated node.Node nodes = 2;
}
message Bucket {
repeated node.Node nodes = 2;
}
message BucketList {
repeated node.Node nodes = 1;
}
// PingNode
message PingNodeRequest {
bytes id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
string address = 2;
}
message PingNodeResponse {
bool ok = 1;
}
message LookupNodeRequest {
string id = 1;
string address = 2;
}
message LookupNodeResponse {
node.Node node = 1;
node.NodeMetadata meta = 2;
}
message NodeInfoRequest {
node.NodeAddress address = 1;
}
message NodeInfoResponse {
bytes id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
node.NodeType type = 2;
node.NodeOperator operator = 3;
node.NodeCapacity capacity = 4;
}
message FindNearRequest {
bytes id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
bytes start = 2 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
int64 limit = 3;
}
message FindNearResponse {
repeated node.Node nodes = 2;
}