2019-12-05 10:42:20 -05:00
|
|
|
syntax = "proto3";
|
2021-11-11 08:40:13 -05:00
|
|
|
option go_package = "./proto";
|
2019-12-05 10:42:20 -05:00
|
|
|
|
|
|
|
package proto;
|
|
|
|
|
|
|
|
service NezhaService {
|
2024-11-22 23:43:02 -05:00
|
|
|
rpc ReportSystemState(stream State) returns (stream Receipt) {}
|
2024-11-22 09:40:43 -05:00
|
|
|
rpc ReportSystemInfo(Host) returns (Receipt) {}
|
2024-12-04 11:11:34 -05:00
|
|
|
rpc RequestTask(stream TaskResult) returns (stream Task) {}
|
2024-11-22 09:40:43 -05:00
|
|
|
rpc IOStream(stream IOStreamData) returns (stream IOStreamData) {}
|
|
|
|
rpc ReportGeoIP(GeoIP) returns (GeoIP) {}
|
2024-12-06 23:19:48 -05:00
|
|
|
rpc ReportSystemInfo2(Host) returns (Uint64Receipt) {}
|
2019-12-07 05:14:40 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
message Host {
|
2024-11-22 09:40:43 -05:00
|
|
|
string platform = 1;
|
|
|
|
string platform_version = 2;
|
|
|
|
repeated string cpu = 3;
|
|
|
|
uint64 mem_total = 4;
|
|
|
|
uint64 disk_total = 5;
|
|
|
|
uint64 swap_total = 6;
|
|
|
|
string arch = 7;
|
|
|
|
string virtualization = 8;
|
|
|
|
uint64 boot_time = 9;
|
|
|
|
string version = 10;
|
|
|
|
repeated string gpu = 11;
|
2019-12-05 10:42:20 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
message State {
|
2024-11-22 09:40:43 -05:00
|
|
|
double cpu = 1;
|
|
|
|
uint64 mem_used = 2;
|
|
|
|
uint64 swap_used = 3;
|
|
|
|
uint64 disk_used = 4;
|
|
|
|
uint64 net_in_transfer = 5;
|
|
|
|
uint64 net_out_transfer = 6;
|
|
|
|
uint64 net_in_speed = 7;
|
|
|
|
uint64 net_out_speed = 8;
|
|
|
|
uint64 uptime = 9;
|
|
|
|
double load1 = 10;
|
|
|
|
double load5 = 11;
|
|
|
|
double load15 = 12;
|
|
|
|
uint64 tcp_conn_count = 13;
|
|
|
|
uint64 udp_conn_count = 14;
|
|
|
|
uint64 process_count = 15;
|
|
|
|
repeated State_SensorTemperature temperatures = 16;
|
|
|
|
repeated double gpu = 17;
|
2024-06-01 07:11:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
message State_SensorTemperature {
|
2024-11-22 09:40:43 -05:00
|
|
|
string name = 1;
|
|
|
|
double temperature = 2;
|
2019-12-05 10:42:20 -05:00
|
|
|
}
|
|
|
|
|
2021-01-15 11:45:49 -05:00
|
|
|
message Task {
|
2024-11-22 09:40:43 -05:00
|
|
|
uint64 id = 1;
|
|
|
|
uint64 type = 2;
|
|
|
|
string data = 3;
|
2019-12-07 05:14:40 -05:00
|
|
|
}
|
|
|
|
|
2021-01-15 11:45:49 -05:00
|
|
|
message TaskResult {
|
2024-11-22 09:40:43 -05:00
|
|
|
uint64 id = 1;
|
|
|
|
uint64 type = 2;
|
|
|
|
float delay = 3;
|
|
|
|
string data = 4;
|
|
|
|
bool successful = 5;
|
2019-12-07 05:14:40 -05:00
|
|
|
}
|
|
|
|
|
2024-11-22 09:40:43 -05:00
|
|
|
message Receipt { bool proced = 1; }
|
2024-07-14 00:47:36 -04:00
|
|
|
|
2024-12-06 23:19:48 -05:00
|
|
|
message Uint64Receipt { uint64 data = 1; }
|
2024-12-06 22:06:42 -05:00
|
|
|
|
2024-11-22 09:40:43 -05:00
|
|
|
message IOStreamData { bytes data = 1; }
|
2024-07-28 01:59:58 -04:00
|
|
|
|
|
|
|
message GeoIP {
|
2024-11-22 09:40:43 -05:00
|
|
|
bool use6 = 1;
|
|
|
|
IP ip = 2;
|
|
|
|
string country_code = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message IP {
|
|
|
|
string ipv4 = 1;
|
|
|
|
string ipv6 = 2;
|
|
|
|
}
|