Files
speedrun/proto/portal/portal.proto

96 lines
2.1 KiB
Protocol Buffer

syntax = "proto3";
option go_package = "github.com/dpogorzelski/speedrun/proto/portal";
package portal;
enum State {
UNKNOWN = 0;
CHANGED = 1;
UNCHANGED = 2;
}
message CommandRequest {
string name = 1;
repeated string args = 2;
}
message CommandResponse {
State state = 1;
string message = 2;
}
message ServiceRequest {
string name = 1;
}
message ServiceResponse {
State state = 1;
string message = 2;
}
message ServiceStatusResponse {
State state = 1;
string loadstate = 2;
string activestate = 3;
string substate = 4;
}
message CPUusageRequest {}
message CPUusageResponse {
int32 loadavg1 = 1;
int32 loadavg5 = 2;
int32 loadavg15 = 3;
}
message FileReadRequest {
string path = 1;
}
message FileReadResponse {
State state = 1;
string content = 2;
}
message FileCpRequest {
string src = 1;
string dst = 2;
bytes content = 3;
bool remoteSrc = 4;
bool remoteDst =5;
}
message FileCpResponse {
State state = 1;
bytes content = 2;
}
message SystemRebootRequest {}
message SystemRebootResponse {
State state = 1;
string message = 2;
}
message SystemShutdownRequest {}
message SystemShutdownResponse {
State state = 1;
string message = 2;
}
service Portal {
rpc ServiceRestart(ServiceRequest) returns (ServiceResponse) {}
rpc ServiceStart(ServiceRequest) returns (ServiceResponse) {}
rpc ServiceStop(ServiceRequest) returns (ServiceResponse) {}
rpc ServiceStatus(ServiceRequest) returns (ServiceStatusResponse) {}
rpc RunCommand(CommandRequest) returns (CommandResponse) {}
rpc CPUusage(CPUusageRequest) returns (CPUusageResponse) {}
rpc FileRead(FileReadRequest) returns (FileReadResponse) {}
rpc FileCp(FileCpRequest) returns (FileCpResponse) {}
rpc SystemReboot(SystemRebootRequest) returns (SystemRebootResponse) {}
rpc SystemShutdown(SystemShutdownRequest) returns (SystemShutdownResponse) {}
// --target group1 --target group2
// rpc CPUProfile(CPUProfileRequest) returns (CPUProfileResponse) {}
// rpc MemProfile(MemProfileRequest) returns (MemProfileResponse) {}
// rpc EnsureMountedDisk()
}