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 {
|
2021-01-15 11:45:49 -05:00
|
|
|
rpc ReportSystemState(State)returns(Receipt){}
|
|
|
|
rpc ReportSystemInfo(Host)returns(Receipt){}
|
|
|
|
rpc ReportTask(TaskResult)returns(Receipt){}
|
|
|
|
rpc RequestTask(Host)returns(stream Task){}
|
2019-12-07 05:14:40 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
message Host {
|
|
|
|
string platform = 1;
|
|
|
|
string platform_version = 2;
|
|
|
|
repeated string cpu = 3;
|
2019-12-11 08:50:49 -05:00
|
|
|
uint64 mem_total = 4;
|
|
|
|
uint64 disk_total = 5;
|
|
|
|
uint64 swap_total = 6;
|
|
|
|
string arch = 7;
|
|
|
|
string virtualization = 8;
|
|
|
|
uint64 boot_time = 9;
|
|
|
|
string ip = 10;
|
|
|
|
string country_code = 11;
|
|
|
|
string version = 12;
|
2024-06-22 22:27:33 -04:00
|
|
|
repeated string gpu = 13;
|
2019-12-05 10:42:20 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
message State {
|
2019-12-07 05:14:40 -05:00
|
|
|
double cpu = 1;
|
|
|
|
uint64 mem_used = 3;
|
2019-12-11 08:50:49 -05:00
|
|
|
uint64 swap_used = 4;
|
|
|
|
uint64 disk_used = 5;
|
|
|
|
uint64 net_in_transfer = 6;
|
|
|
|
uint64 net_out_transfer = 7;
|
|
|
|
uint64 net_in_speed = 8;
|
|
|
|
uint64 net_out_speed = 9;
|
|
|
|
uint64 uptime = 10;
|
2021-08-15 04:38:05 -04:00
|
|
|
double load1 = 11;
|
|
|
|
double load5 = 12;
|
|
|
|
double load15 = 13;
|
|
|
|
uint64 tcp_conn_count = 14;
|
|
|
|
uint64 udp_conn_count = 15;
|
|
|
|
uint64 process_count = 16;
|
2024-06-01 07:11:48 -04:00
|
|
|
repeated State_SensorTemperature temperatures = 17;
|
2024-06-22 22:27:33 -04:00
|
|
|
double gpu = 18;
|
2024-06-01 07:11:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
message State_SensorTemperature {
|
|
|
|
string name = 1;
|
|
|
|
double temperature = 2;
|
2019-12-05 10:42:20 -05:00
|
|
|
}
|
|
|
|
|
2021-01-15 11:45:49 -05:00
|
|
|
message Task {
|
|
|
|
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 {
|
|
|
|
uint64 id = 1;
|
|
|
|
uint64 type = 2;
|
|
|
|
float delay = 3;
|
|
|
|
string data = 4;
|
|
|
|
bool successful = 5;
|
2019-12-07 05:14:40 -05:00
|
|
|
}
|
|
|
|
|
2021-01-15 11:45:49 -05:00
|
|
|
message Receipt{
|
|
|
|
bool proced = 1;
|
2019-12-05 10:42:20 -05:00
|
|
|
}
|