54 lines
1 KiB
Protocol Buffer
54 lines
1 KiB
Protocol Buffer
|
syntax = "proto3";
|
||
|
|
||
|
import "google/protobuf/empty.proto";
|
||
|
|
||
|
package prymn;
|
||
|
|
||
|
message EchoRequest {
|
||
|
string message = 1;
|
||
|
}
|
||
|
|
||
|
message EchoResponse {
|
||
|
string message = 1;
|
||
|
}
|
||
|
|
||
|
message SysInfoResponse {
|
||
|
message Cpu {
|
||
|
uint64 freq_mhz = 1;
|
||
|
float usage = 2;
|
||
|
}
|
||
|
|
||
|
message Disk {
|
||
|
string name = 1;
|
||
|
uint64 total_bytes = 2;
|
||
|
uint64 avail_bytes = 3;
|
||
|
string mount_point = 4;
|
||
|
}
|
||
|
|
||
|
uint64 uptime = 1;
|
||
|
string hostname = 2;
|
||
|
string os = 3;
|
||
|
uint64 mem_total_bytes = 4;
|
||
|
uint64 mem_avail_bytes = 5;
|
||
|
uint64 swap_total_bytes = 6;
|
||
|
uint64 swap_free_bytes = 7;
|
||
|
repeated Cpu cpus = 8;
|
||
|
repeated Disk disks = 9;
|
||
|
}
|
||
|
|
||
|
message ExecRequest {
|
||
|
string program = 1;
|
||
|
repeated string args = 2;
|
||
|
}
|
||
|
|
||
|
message ExecResponse {
|
||
|
string stdout = 1;
|
||
|
string stderr = 2;
|
||
|
}
|
||
|
|
||
|
service Agent {
|
||
|
rpc Echo(EchoRequest) returns (EchoResponse);
|
||
|
rpc GetSysInfo(google.protobuf.Empty) returns (SysInfoResponse);
|
||
|
rpc Exec(ExecRequest) returns (stream ExecResponse);
|
||
|
}
|