storj/pkg/pb/inspector.proto
Stefan Benten bae4c820ee
Add Version Information into KAD Network and SatelliteDB & Change Selection Process (#1648)
* Initial Webserver Draft for Version Controlling

* Rename type to avoid confusion

* Move Function Calls into Version Package

* Fix Linting and Language Typos

* Fix Linting and Spelling Mistakes

* Include Copyright

* Include Copyright

* Adjust Version-Control Server to return list of Versions

* Linting

* Improve Request Handling and Readability

* Add Configuration File Option
Add Systemd Service file

* Add Logging to File

* Smaller Changes

* Add Semantic Versioning and refuses outdated Software from Startup (#1612)

* implements internal Semantic Version library

* adds version logging + reporting to process

* Advance SemVer struct for easier handling

* Add Accepted Version Store

* Fix Function

* Restructure

* Type Conversion

* Handle Version String properly

* Add Note about array index

* Set temporary Default Version

* Add Copyright

* Adding Version to Dashboard

* Adding Version Info Log

* Renaming and adding CheckerProcess

* Iteration Sync

* Iteration V2

* linting

* made LogAndReportVersion a go routine

* Refactor to Go Routine

* Add Context to Go Routine and allow Operation if Lookup to Control Server fails

* Handle Unmarshal properly

* Linting

* Relocate Version Checks

* Relocating Version Check and specified default Version for now

* Linting Error Prevention

* Refuse Startup on outdated Version

* Add Startup Check Function

* Straighten Logging

* Dont force Shutdown if --dev flag is set

* Create full Service/Peer Structure for ControlServer

* Linting

* Straighting Naming

* Finish VersionControl Service Layout

* Improve Error Handling

* Change Listening Address

* Move Checker Function

* Remove VersionControl Peer

* Linting

* Linting

* Create VersionClient Service

* Renaming

* Add Version Client to Peer Definitions

* Linting and Renaming

* Linting

* Remove Transport Checks for now

* Move to Client Side Flag

* Remove check

* Linting

* Transport Client Version Intro

* Adding Version Client to Transport Client

* Add missing parameter

* Adding Version Check, to set Allowed = true

* Set Default to true, testing

* Restructuring Code

* Uplink Changes

* Add more proper Defaults

* Renaming of Version struct

* Dont pass Service use Pointer

* Set Defaults for Versioning Checks

* Put HTTP Server in go routine

* Add Versioncontrol to Storj-Sim

* Testplanet Fixes

* Linting

* Add Error Handling and new Server Struct

* Move Lock slightly

* Reduce Race Potentials

* Remove unnecessary files

* Linting

* Add Proper Transport Handling

* small fixes

* add fence for allowed check

* Add Startup Version Check and Service Naming

* make errormessage private

* Add Comments about VersionedClient

* Linting

* Remove Checks that refuse outgoing connections

* Remove release cmd

* Add Release Script

* Linting

* Update to use correct Values

* Change Timestamp handling

* Adding Protobuf changes back in

* Adding SatelliteDB Changes and adding Storj Node Version to PB

* Add Migration Table

* Add Default Stats for Creation

* Move to BigInt

* Proper SQL Migration

* Ensure minimum Version is passed to the node selection

* Linting...

* Remove VersionedClient and adjust smaller changes from prior merge

* Linting

* Fix PB Message Handling and Query for Node Selection

* some future-proofing type changes

Change-Id: I3cb5018dcccdbc9739fe004d859065992720caaf

* fix a compiler error

Change-Id: If66bb92d8b98e31cd618ecec9c6448ab9b037fa5

* Comment on Constant for Overlay

* Remove NOT NULL and add epoch call as function

* add versions to bootstrap and satellites

Change-Id: I436944589ea5f21600cdd997742a84fe0b16e47b

* Change Update Migration

* Fix DB Migration

* Increase Timeout temporarily, to see whats going on

* Remove unnecessary const and vars
Cleanup Function calls from deprecated NodeVersion struct

* Updated Protopuf, removed depcreated Code from Inspector

* Implement NodeVersion into InfoResponse

* Regenerated locked.go

* Linting

* Fix Tests

* Remove unnecessary constant

* Update Function and Flag Description

* Remove Empty Stat Creation

* return properly with error

* Remove unnecessary struct

* simplify migration step

* Update Inspector to return Version Info

* Update local Endpoint Version Handling

* Reset Travis Timeout

* Add Default for CommitHash

* single quotes
2019-04-10 08:04:24 +02:00

240 lines
6.7 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";
import "pointerdb.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.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);
// DumpNodes returns all the nodes in the node database
rpc DumpNodes(DumpNodesRequest) returns (DumpNodesResponse);
}
service OverlayInspector {
// CountNodes returns the number of nodes in the cache
rpc CountNodes(CountNodesRequest) returns (CountNodesResponse);
// DumpNodes returns all the nodes in the cache
rpc DumpNodes(DumpNodesRequest) returns (DumpNodesResponse);
// 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);
}
service PieceStoreInspector {
// Stats return space and bandwidth stats for a storagenode
rpc Stats(StatsRequest) returns (StatSummaryResponse) {}
// Dashboard returns stats for a specific storagenode
rpc Dashboard(DashboardRequest) returns (DashboardResponse) {}
}
service IrreparableInspector {
// ListIrreparableSegments returns damaged segments
rpc ListIrreparableSegments(ListIrreparableSegmentsRequest) returns (ListIrreparableSegmentsResponse);
}
service HealthInspector {
// ObjectHealth will return stats about the health of an object
rpc ObjectHealth(ObjectHealthRequest) returns (ObjectHealthResponse) {}
// SegmentHealth will return stats about the health of a segment
rpc SegmentHealth(SegmentHealthRequest) returns (SegmentHealthResponse) {}
}
// ListSegments
message ListIrreparableSegmentsRequest {
int32 limit = 1;
int32 offset = 2;
}
message IrreparableSegment {
bytes path = 1;
pointerdb.Pointer segment_detail = 2;
int32 lost_pieces = 3;
int64 last_repair_attempt = 4;
int64 repair_attempt_count = 5;
}
message ListIrreparableSegmentsResponse {
repeated IrreparableSegment segments = 1;
}
// 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 {
bytes id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
node.NodeAddress address = 2;
}
message NodeInfoResponse {
node.NodeType type = 1;
node.NodeOperator operator = 2;
node.NodeCapacity capacity = 3;
node.NodeVersion version = 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;
}
message DumpNodesRequest {}
message DumpNodesResponse {
repeated node.Node nodes = 1;
}
message StatsRequest {
}
message StatSummaryResponse {
int64 used_space = 1;
int64 available_space = 2;
int64 used_ingress = 3;
int64 used_egress = 4;
int64 used_bandwidth = 5;
int64 available_bandwidth = 6;
}
message DashboardRequest {
}
message DashboardResponse {
bytes node_id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
int64 node_connections = 2;
string bootstrap_address = 3;
string internal_address = 4;
string external_address = 5;
StatSummaryResponse stats = 6;
google.protobuf.Duration uptime = 7;
google.protobuf.Timestamp last_pinged = 8;
google.protobuf.Timestamp last_queried = 9;
}
message SegmentHealthRequest {
bytes bucket = 1; // segment bucket name
bytes encrypted_path = 2; // segment encrypted path
int64 segment_index = 3; // segment index
bytes project_id = 4; // segment project id
}
message SegmentHealth {
int32 online_nodes = 1; // amount of pieces with nodes that are online
bytes segment = 2; // path formatted segment index
}
message SegmentHealthResponse {
SegmentHealth health = 1; // Information about a segment's health
pointerdb.RedundancyScheme redundancy = 2; // expected segment info
}
message ObjectHealthRequest {
bytes encrypted_path = 1; // object encrypted path
bytes bucket = 2; // object bucket name
bytes project_id = 3; // object project id
int64 start_after_segment = 4; // Get all segments after specified segment index
int64 end_before_segment = 5; // Stop at segment before specified segment index
int32 limit = 6; // Max number of segments that are checked
}
message ObjectHealthResponse {
repeated SegmentHealth segments = 1; // actual segment info
pointerdb.RedundancyScheme redundancy = 2; // expected segment info
}