@@ -22,6 +22,7 @@ message ListContentResponse {
|
||||
repeated Link links = 1;
|
||||
repeated Item monitors = 2;
|
||||
repeated Item exec = 3;
|
||||
repeated Service services = 4;
|
||||
}
|
||||
|
||||
message DocMeta {
|
||||
@@ -49,11 +50,44 @@ message SaveDocResponse {
|
||||
string hash = 1;
|
||||
}
|
||||
|
||||
// One card in the Services view: a systemd user unit or a docker compose project.
|
||||
enum ServiceKind {
|
||||
SYSTEMD = 0;
|
||||
DOCKER = 1;
|
||||
}
|
||||
|
||||
message Service {
|
||||
ServiceKind kind = 1;
|
||||
string name = 2; // unit name without .service / compose project name (or container name if unlabeled)
|
||||
string state = 3; // systemd: ActiveState. docker: active | partial | inactive
|
||||
string substate = 4; // systemd: SubState. docker: "up/total"
|
||||
string load_state = 5; // systemd only: loaded | not-found (= disabled by the user, not an error)
|
||||
string unit_file_state = 6; // systemd only: enabled | disabled | static
|
||||
repeated string containers = 7; // docker only: containers the card controls
|
||||
string error = 8; // probe failure, empty = ok
|
||||
}
|
||||
|
||||
enum ServiceOp {
|
||||
START = 0;
|
||||
STOP = 1;
|
||||
RESTART = 2;
|
||||
}
|
||||
|
||||
message ServiceActionRequest {
|
||||
string name = 1;
|
||||
ServiceKind kind = 2;
|
||||
ServiceOp op = 3;
|
||||
}
|
||||
message ServiceActionResponse {
|
||||
string output = 1;
|
||||
}
|
||||
|
||||
service HomelabService {
|
||||
rpc ListContent(ListContentRequest) returns (ListContentResponse);
|
||||
rpc ListDocs(ListDocsRequest) returns (ListDocsResponse);
|
||||
rpc GetDoc(GetDocRequest) returns (GetDocResponse);
|
||||
rpc SaveDoc(SaveDocRequest) returns (SaveDocResponse);
|
||||
rpc ServiceAction(ServiceActionRequest) returns (ServiceActionResponse);
|
||||
rpc RunScript(RunScriptRequest) returns (RunScriptResponse);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user