2023-06-13 13:02:49 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
import "google/protobuf/empty.proto";
|
|
|
|
|
|
|
|
package prymn;
|
|
|
|
|
2023-08-12 09:37:01 +00:00
|
|
|
message SystemHealth {
|
|
|
|
// Comma-separated statuses
|
|
|
|
string status = 1;
|
2023-06-13 13:02:49 +00:00
|
|
|
}
|
|
|
|
|
2023-08-12 09:37:01 +00:00
|
|
|
message TaskHealth {
|
2023-11-14 15:23:50 +00:00
|
|
|
string started_on = 1;
|
|
|
|
float progress = 2;
|
2023-08-12 09:37:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message HealthResponse {
|
|
|
|
string version = 1;
|
|
|
|
SystemHealth system = 2;
|
|
|
|
map<string, TaskHealth> tasks = 3;
|
2023-06-13 13:02:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2023-11-14 15:23:50 +00:00
|
|
|
uint32 updates_available = 10;
|
2023-06-13 13:02:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message ExecRequest {
|
|
|
|
string program = 1;
|
|
|
|
repeated string args = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ExecResponse {
|
2023-11-14 15:23:50 +00:00
|
|
|
oneof out {
|
2023-06-15 10:55:24 +00:00
|
|
|
string stdout = 1;
|
|
|
|
string stderr = 2;
|
|
|
|
string error = 3;
|
2023-11-14 15:23:50 +00:00
|
|
|
int32 exit_code = 4;
|
2023-06-15 10:55:24 +00:00
|
|
|
}
|
2023-06-13 13:02:49 +00:00
|
|
|
}
|
|
|
|
|
2023-11-14 15:23:50 +00:00
|
|
|
message SysUpdateRequest {
|
|
|
|
bool dry_run = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SysUpdateResponse {
|
|
|
|
string output = 1;
|
|
|
|
int32 progress = 2;
|
|
|
|
}
|
|
|
|
|
2023-06-13 13:02:49 +00:00
|
|
|
service Agent {
|
2023-08-12 09:37:01 +00:00
|
|
|
rpc Health(google.protobuf.Empty) returns (stream HealthResponse);
|
2023-06-13 13:02:49 +00:00
|
|
|
rpc Exec(ExecRequest) returns (stream ExecResponse);
|
2023-11-14 15:23:50 +00:00
|
|
|
rpc GetSysInfo(google.protobuf.Empty) returns (SysInfoResponse);
|
|
|
|
rpc SysUpdate(SysUpdateRequest) returns (stream SysUpdateResponse);
|
2023-06-13 13:02:49 +00:00
|
|
|
}
|