nezha/proto/nezha.proto

50 lines
946 B
Protocol Buffer
Raw Normal View History

2019-12-05 10:42:20 -05:00
syntax = "proto3";
package proto;
service NezhaService {
2019-12-07 05:14:40 -05:00
rpc Heartbeat(Beat)returns(stream Command){}
2019-12-05 10:42:20 -05:00
rpc ReportState(State)returns(Receipt){}
2019-12-07 05:14:40 -05:00
rpc Register(Host)returns(Receipt){}
}
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;
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;
2019-12-05 10:42:20 -05:00
}
message Receipt{
2019-12-07 05:14:40 -05:00
bool proced = 1;
}
message Beat {
string timestamp = 1;
}
message Command {
uint64 type = 1;
string data = 2;
2019-12-05 10:42:20 -05:00
}