nezha/proto/nezha.proto

46 lines
817 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;
string arch = 4;
string virtualization = 5;
string uptime = 6;
string boot_time = 7;
string version = 8;
2019-12-05 10:42:20 -05:00
}
message State {
2019-12-07 05:14:40 -05:00
double cpu = 1;
uint64 mem_total = 2;
uint64 mem_used = 3;
uint64 swap_total = 4;
uint64 swap_used = 5;
uint64 disk_total = 6;
uint64 disk_used = 7;
uint64 net_in = 8;
uint64 net_out = 9;
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
}